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

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: More work 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..b8a25e91039f44485ada0f384a4961a5c65a2335 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>} */
Dan Beam 2017/04/12 02:32:02 @override maybe?
dpapad 2017/04/12 03:22:52 Tried @override and compiler seems to be happy eit
+ focusConfig: {
+ type: Object,
+ observer: 'focusConfigChanged_',
+ },
+ },
+
+ /**
+ * @param {!Map<string, string>} current
Dan Beam 2017/04/12 02:32:02 nit: newConfig, oldConfig
dpapad 2017/04/12 03:22:52 Done.
+ * @param {?Map<string, string>} previous
+ * @private
+ */
+ focusConfigChanged_: function(current, previous) {
+ if (previous != undefined) {
+ // Should never happen since focusConfig is set only once on the parent.
+ return;
+ }
Dan Beam 2017/04/12 02:32:02 assert(!oldConfig);
dpapad 2017/04/12 03:22:52 Done.
+
+ // 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.
dpapad 2017/04/12 02:05:28 Populating this.focusConfig only after it is set t
+ 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