Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2607)

Unified Diff: chrome/browser/resources/settings/site_settings_page/site_settings_page.js

Issue 2813033004: MD Settings: Restore focus after exiting Content settings sub-subpages. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/site_settings_page/site_settings_page.js
diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.js b/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
index b1e40a46a8da057ca75e69b093d3d8abc6b6383a..51897d919d86a9ddfddb568c975775b5fc77d3de 100644
--- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
+++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
@@ -49,6 +49,8 @@ Polymer({
}
},
+ /** @type {!Map<string, string>} */
+ focusConfig: Object,
},
/** @override */
@@ -78,6 +80,23 @@ Polymer({
'setHandlersEnabled',
this.updateHandlersEnabled_.bind(this));
this.browserProxy.observeProtocolHandlersEnabledState();
+
+ var getDeepSelector = function(selector) {
+ return '* /deep/ ' + selector;
+ };
Dan Beam 2017/04/12 01:05:26 'getDeepSelector()'.length > "'* /deep/ ".length
dpapad 2017/04/12 02:05:28 Not applicable anymore.
+
+ this.focusConfig.set(
Dan Beam 2017/04/12 01:05:26 why does this object already exist?
dpapad 2017/04/12 02:05:28 This is now explained in the comment. The |focusCo
+ settings.Route.SITE_SETTINGS_COOKIES.path,
+ getDeepSelector('#cookies .subpage-arrow'));
Dan Beam 2017/04/12 01:05:26 can we just inline the /deep/ calls? '* /deep/ #c
dpapad 2017/04/12 02:05:28 See latest patch.
+ this.focusConfig.set(
+ settings.Route.SITE_SETTINGS_LOCATION.path,
+ getDeepSelector('#location .subpage-arrow'));
+ this.focusConfig.set(
+ settings.Route.SITE_SETTINGS_CAMERA.path,
+ getDeepSelector('#camera .subpage-arrow'));
+ this.focusConfig.set(
+ settings.Route.SITE_SETTINGS_MICROPHONE.path,
+ getDeepSelector('#microphone .subpage-arrow'));
},
/**

Powered by Google App Engine
This is Rietveld 408576698