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

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: Address comments. 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
« no previous file with comments | « chrome/browser/resources/settings/site_settings_page/site_settings_page.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5c489d728540b8434043cf4c064d24cad002a69d 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,54 @@ Polymer({
}
},
+
+ /** @type {!Map<string, string>} */
+ focusConfig: {
+ type: Object,
+ observer: 'focusConfigChanged_',
+ },
+ },
+
+ /**
+ * @param {!Map<string, string>} newConfig
+ * @param {?Map<string, string>} oldConfig
+ * @private
+ */
+ focusConfigChanged_: function(newConfig, oldConfig) {
+ // focusConfig is set only once on the parent, so this observer should only
+ // fire once.
+ assert(!oldConfig);
+
+ // Populate the |focusConfig| map of the parent <settings-animated-pages>
+ // element, with additional entries that correspond to subpage trigger
+ // elements residing in this element's Shadow DOM.
+ var R = settings.Route;
+ [
+ [R.SITE_SETTINGS_COOKIES, 'cookies'],
+ [R.SITE_SETTINGS_LOCATION, 'location'],
+ [R.SITE_SETTINGS_CAMERA, 'camera'],
+ [R.SITE_SETTINGS_MICROPHONE, 'microphone'],
+ [R.SITE_SETTINGS_NOTIFICATIONS, 'notifications'],
+ [R.SITE_SETTINGS_JAVASCRIPT,'javascript'],
+ [R.SITE_SETTINGS_FLASH,'flash'],
+ [R.SITE_SETTINGS_IMAGES,'images'],
+ [R.SITE_SETTINGS_POPUPS,'popups'],
+ [R.SITE_SETTINGS_BACKGROUND_SYNC,'background-sync'],
+ [R.SITE_SETTINGS_AUTOMATIC_DOWNLOADS,'automatic-downloads'],
+ [R.SITE_SETTINGS_UNSANDBOXED_PLUGINS,'unsandboxed-plugins'],
+ [R.SITE_SETTINGS_HANDLERS,'protocol-handlers'],
+ [R.SITE_SETTINGS_MIDI_DEVICES,'midi-devices'],
+ [R.SITE_SETTINGS_SUBRESOURCE_FILTER,'subresource-filter'],
+ [R.SITE_SETTINGS_ZOOM_LEVELS,'zoom-levels'],
+ [R.SITE_SETTINGS_USB_DEVICES,'usb-devices'],
+ [R.SITE_SETTINGS_PDF_DOCUMENTS,'pdf-documents'],
+ [R.SITE_SETTINGS_PROTECTED_CONTENT,'protected-content'],
+ ].forEach(function(pair) {
+ var route = pair[0];
+ var id = pair[1];
+ this.focusConfig.set(
+ route.path, '* /deep/ #' + id + ' .subpage-arrow');
+ }.bind(this));
},
/** @override */
« no previous file with comments | « chrome/browser/resources/settings/site_settings_page/site_settings_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698