-
Notifications
You must be signed in to change notification settings - Fork 877
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
cr.define('settings', function() { | ||
// use value defined in page_visibility.js in guest mode | ||
if (loadTimeData.getBoolean('isGuest')) return; | ||
|
||
// We need to specify values for every attribute in pageVisibility instead of | ||
// only overriding specific attributes here because chromium does not | ||
// explicitly define pageVisibility in page_visibility.js since polymer only | ||
// notifies after a property is set. | ||
// Use proxy objects here so we only need to write out the attributes we | ||
// would like to hide. | ||
|
||
const appearanceHandler = { | ||
get: function(obj, prop) { | ||
return prop === 'setTheme' ? false : true; | ||
} | ||
}; | ||
|
||
const handler = { | ||
get: function(obj, prop) { | ||
if (prop === 'appearance') return new Proxy({}, appearanceHandler); | ||
return prop === 'a11y' ? false : true; | ||
} | ||
}; | ||
|
||
let proxy = new Proxy({}, handler); | ||
|
||
return { pageVisibility: proxy }; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
patches/chrome-browser-resources-settings-page_visibility.html.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
diff --git a/chrome/browser/resources/settings/page_visibility.html b/chrome/browser/resources/settings/page_visibility.html | ||
index 8ea50773be028e98aa2d4f90477a05f69f5a476e..6f8314a72295c599bdf97831436562c205509f61 100644 | ||
--- a/chrome/browser/resources/settings/page_visibility.html | ||
+++ b/chrome/browser/resources/settings/page_visibility.html | ||
@@ -1,3 +1,4 @@ | ||
<link rel="import" href="chrome://resources/html/cr.html"> | ||
|
||
<script src="page_visibility.js"></script> | ||
+<script src="brave_page_visibility.js"></script> |