Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branding in settings and history pages #212

Merged
merged 3 commits into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
663 changes: 663 additions & 0 deletions browser/browser_resources.grd

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions browser/resources/settings/brave_page_visibility.js
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 };
});
3 changes: 3 additions & 0 deletions browser/resources/settings/settings_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,9 @@
<structure name="IDR_SETTINGS_PAGE_VISIBILITY_HTML"
file="page_visibility.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_BRAVE_PAGE_VISIBILITY_JS"
file="brave_page_visibility.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_PAGE_VISIBILITY_JS"
file="page_visibility.js"
type="chrome_html"
Expand Down
20 changes: 20 additions & 0 deletions patches/chrome-browser-resources-md_history-app.html.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/chrome/browser/resources/md_history/app.html b/chrome/browser/resources/md_history/app.html
index 13481a8e52052efd85f99172f165010031ce92f6..d9a48f7fb13de0b3fb8c2e34cd238bf69aa40ff8 100644
--- a/chrome/browser/resources/md_history/app.html
+++ b/chrome/browser/resources/md_history/app.html
@@ -92,6 +92,7 @@
query-result="[[queryResult_]]"
path="history">
</history-list>
+<if expr=_google_chrome>
<template is="dom-if" if="[[syncedTabsSelected_(selectedPage_)]]">
<history-synced-device-manager id="synced-devices"
session-list="[[queryResult_.sessionList]]"
@@ -100,6 +101,7 @@
path="syncedTabs">
</history-synced-device-manager>
</template>
+</if>
</iron-pages>
</div>

18 changes: 18 additions & 0 deletions patches/chrome-browser-resources-md_history-side_bar.html.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/chrome/browser/resources/md_history/side_bar.html b/chrome/browser/resources/md_history/side_bar.html
index 49b11840b7b7215cb8cf8ce641883c48072a53d2..5237c1b68dc73ed0c81eb7a91c387633093c4477 100644
--- a/chrome/browser/resources/md_history/side_bar.html
+++ b/chrome/browser/resources/md_history/side_bar.html
@@ -99,11 +99,13 @@
$i18n{historyMenuItem}
<paper-ripple></paper-ripple>
</a>
+<if expr="_google_chrome">
<a href="/syncedTabs" class="page-item" path="syncedTabs"
on-click="onItemClick_">
$i18n{openTabsMenuItem}
<paper-ripple></paper-ripple>
</a>
+</if>
<div class="separator"></div>
<a id="clear-browsing-data"
href="chrome://settings/clearBrowserData"
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/chrome/browser/resources/settings/people_page/people_page.html b/chrome/browser/resources/settings/people_page/people_page.html
index 2adc21adf829c182fa2d496745d6d4402bc0b349..26db5c5846142470e98b6353c1e3f6c2a68135b7 100644
--- a/chrome/browser/resources/settings/people_page/people_page.html
+++ b/chrome/browser/resources/settings/people_page/people_page.html
@@ -197,9 +197,11 @@
<if expr="not chromeos">
</template> <!-- if="[[!diceEnabled_]]" -->
</if>
+<if expr="_google_chrome">
<div class="settings-box" hidden="[[syncStatus.signinAllowed]]">
$i18n{syncDisabledByAdministrator}
</div>
+</if>
</template>

<if expr="not chromeos">