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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-site-settings-page' is the settings page containing privacy and 7 * 'settings-site-settings-page' is the settings page containing privacy and
8 * security site settings. 8 * security site settings.
9 */ 9 */
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 }, 42 },
43 43
44 /** @private */ 44 /** @private */
45 enableSafeBrowsingSubresourceFilter_: { 45 enableSafeBrowsingSubresourceFilter_: {
46 type: Boolean, 46 type: Boolean,
47 value: function() { 47 value: function() {
48 return loadTimeData.getBoolean('enableSafeBrowsingSubresourceFilter'); 48 return loadTimeData.getBoolean('enableSafeBrowsingSubresourceFilter');
49 } 49 }
50 }, 50 },
51 51
52
53 /** @type {!Map<string, string>} */
54 focusConfig: {
55 type: Object,
56 observer: 'focusConfigChanged_',
57 },
58 },
59
60 /**
61 * @param {!Map<string, string>} newConfig
62 * @param {?Map<string, string>} oldConfig
63 * @private
64 */
65 focusConfigChanged_: function(newConfig, oldConfig) {
66 // focusConfig is set only once on the parent, so this observer should only
67 // fire once.
68 assert(!oldConfig);
69
70 // Populate the |focusConfig| map of the parent <settings-animated-pages>
71 // element, with additional entries that correspond to subpage trigger
72 // elements residing in this element's Shadow DOM.
73 var R = settings.Route;
74 [
75 [R.SITE_SETTINGS_COOKIES, 'cookies'],
76 [R.SITE_SETTINGS_LOCATION, 'location'],
77 [R.SITE_SETTINGS_CAMERA, 'camera'],
78 [R.SITE_SETTINGS_MICROPHONE, 'microphone'],
79 [R.SITE_SETTINGS_NOTIFICATIONS, 'notifications'],
80 [R.SITE_SETTINGS_JAVASCRIPT,'javascript'],
81 [R.SITE_SETTINGS_FLASH,'flash'],
82 [R.SITE_SETTINGS_IMAGES,'images'],
83 [R.SITE_SETTINGS_POPUPS,'popups'],
84 [R.SITE_SETTINGS_BACKGROUND_SYNC,'background-sync'],
85 [R.SITE_SETTINGS_AUTOMATIC_DOWNLOADS,'automatic-downloads'],
86 [R.SITE_SETTINGS_UNSANDBOXED_PLUGINS,'unsandboxed-plugins'],
87 [R.SITE_SETTINGS_HANDLERS,'protocol-handlers'],
88 [R.SITE_SETTINGS_MIDI_DEVICES,'midi-devices'],
89 [R.SITE_SETTINGS_SUBRESOURCE_FILTER,'subresource-filter'],
90 [R.SITE_SETTINGS_ZOOM_LEVELS,'zoom-levels'],
91 [R.SITE_SETTINGS_USB_DEVICES,'usb-devices'],
92 [R.SITE_SETTINGS_PDF_DOCUMENTS,'pdf-documents'],
93 [R.SITE_SETTINGS_PROTECTED_CONTENT,'protected-content'],
94 ].forEach(function(pair) {
95 var route = pair[0];
96 var id = pair[1];
97 this.focusConfig.set(
98 route.path, '* /deep/ #' + id + ' .subpage-arrow');
99 }.bind(this));
52 }, 100 },
53 101
54 /** @override */ 102 /** @override */
55 ready: function() { 103 ready: function() {
56 this.ContentSettingsTypes = settings.ContentSettingsTypes; 104 this.ContentSettingsTypes = settings.ContentSettingsTypes;
57 this.ALL_SITES = settings.ALL_SITES; 105 this.ALL_SITES = settings.ALL_SITES;
58 106
59 var keys = Object.keys(settings.ContentSettingsTypes); 107 var keys = Object.keys(settings.ContentSettingsTypes);
60 for (var i = 0; i < keys.length; ++i) { 108 for (var i = 0; i < keys.length; ++i) {
61 var key = settings.ContentSettingsTypes[keys[i]]; 109 var key = settings.ContentSettingsTypes[keys[i]];
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 /** 175 /**
128 * Navigate to the route specified in the event dataset. 176 * Navigate to the route specified in the event dataset.
129 * @param {!Event} event The tap event. 177 * @param {!Event} event The tap event.
130 * @private 178 * @private
131 */ 179 */
132 onTapNavigate_: function(event) { 180 onTapNavigate_: function(event) {
133 var dataSet = /** @type {{route: string}} */(event.currentTarget.dataset); 181 var dataSet = /** @type {{route: string}} */(event.currentTarget.dataset);
134 settings.navigateTo(settings.Route[dataSet.route]); 182 settings.navigateTo(settings.Route[dataSet.route]);
135 }, 183 },
136 }); 184 });
OLDNEW
« 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