From 75b5b3b92d96bb95adb1c87622406781c3bb2b0c Mon Sep 17 00:00:00 2001 From: Cezar Augusto Date: Wed, 30 Oct 2019 14:38:12 -0300 Subject: [PATCH] Create `Help Tips` section in settings This creates a new section to host the Wayback Machine toggle option. Option is located under Additional settings panel as per spec. For further info, see https://docs.google.com/document/d/1ioGkGUVmLE0ndfvLRBjDN1d9QtOKeyPOM-33lK0L78k --- app/brave_generated_resources.grd | 7 ++++++ .../brave_default_extensions_page.html | 3 --- .../brave_help_tips_browser_proxy.html | 2 ++ .../brave_help_tips_browser_proxy.js | 20 ++++++++++++++++ .../brave_help_tips_page.html | 16 +++++++++++++ .../brave_help_tips_page.js | 23 +++++++++++++++++++ browser/resources/settings/brave_icons.html | 4 ++++ .../settings/brave_settings_overrides.html | 1 + .../settings/brave_settings_overrides.js | 23 +++++++++++++++++-- .../resources/settings/settings_resources.grd | 6 +++++ .../settings_localized_strings_provider.cc | 4 ++++ 11 files changed, 104 insertions(+), 5 deletions(-) create mode 100644 browser/resources/settings/brave_help_tips_page/brave_help_tips_browser_proxy.html create mode 100644 browser/resources/settings/brave_help_tips_page/brave_help_tips_browser_proxy.js create mode 100644 browser/resources/settings/brave_help_tips_page/brave_help_tips_page.html create mode 100644 browser/resources/settings/brave_help_tips_page/brave_help_tips_page.js diff --git a/app/brave_generated_resources.grd b/app/brave_generated_resources.grd index 29ca0ad17c60..8c54711148ea 100644 --- a/app/brave_generated_resources.grd +++ b/app/brave_generated_resources.grd @@ -400,6 +400,13 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U Access Sync via + + + Help Tips + + + Show Wayback Machine prompt on 404 pages + Light diff --git a/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html b/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html index d7d9bbbe4595..fe7ba3532313 100644 --- a/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html +++ b/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html @@ -78,9 +78,6 @@ sub-label="$i18n{webTorrentEnabledDesc}" on-settings-boolean-control-change="onWebTorrentEnabledChange_"> - + diff --git a/browser/resources/settings/brave_help_tips_page/brave_help_tips_browser_proxy.js b/browser/resources/settings/brave_help_tips_page/brave_help_tips_browser_proxy.js new file mode 100644 index 000000000000..7145da8447b7 --- /dev/null +++ b/browser/resources/settings/brave_help_tips_page/brave_help_tips_browser_proxy.js @@ -0,0 +1,20 @@ +/* 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() { + /** @interface */ + class BraveHelpTipsBrowserProxy {} + + /** + * @implements {settings.BraveHelpTipsBrowserProxy} + */ + class BraveHelpTipsBrowserProxyImpl {} + + cr.addSingletonGetter(BraveHelpTipsBrowserProxyImpl); + + return { + BraveHelpTipsBrowserProxy, + BraveHelpTipsBrowserProxyImpl + }; +}); diff --git a/browser/resources/settings/brave_help_tips_page/brave_help_tips_page.html b/browser/resources/settings/brave_help_tips_page/brave_help_tips_page.html new file mode 100644 index 000000000000..afb765344af1 --- /dev/null +++ b/browser/resources/settings/brave_help_tips_page/brave_help_tips_page.html @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/browser/resources/settings/brave_help_tips_page/brave_help_tips_page.js b/browser/resources/settings/brave_help_tips_page/brave_help_tips_page.js new file mode 100644 index 000000000000..5832b430afc5 --- /dev/null +++ b/browser/resources/settings/brave_help_tips_page/brave_help_tips_page.js @@ -0,0 +1,23 @@ +/* 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/. */ + +(function() { + 'use strict'; + + /** + * 'settings-brave-help-tips-page' is the settings page containing + * brave's help tips features. + */ + Polymer({ + is: 'settings-brave-help-tips-page', + + /** @private {?settings.BraveHelpTipsBrowserProxy} */ + browserProxy_: null, + + /** @override */ + created: function() { + this.browserProxy_ = settings.BraveHelpTipsBrowserProxyImpl.getInstance(); + }, + }); +})(); diff --git a/browser/resources/settings/brave_icons.html b/browser/resources/settings/brave_icons.html index 0dc185cb72d3..e2fc474264d4 100644 --- a/browser/resources/settings/brave_icons.html +++ b/browser/resources/settings/brave_icons.html @@ -63,6 +63,10 @@ + + + diff --git a/browser/resources/settings/brave_settings_overrides.html b/browser/resources/settings/brave_settings_overrides.html index 807b585071b8..3c3549ad4f18 100644 --- a/browser/resources/settings/brave_settings_overrides.html +++ b/browser/resources/settings/brave_settings_overrides.html @@ -7,6 +7,7 @@ +