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

Side by Side Diff: chrome/browser/resources/settings/route.js

Issue 2248083004: Settings: Fix Clear Browsing Data dialog scrolling to Privacy page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 cr.define('settings', function() { 5 cr.define('settings', function() {
6 /** 6 /**
7 * Class for navigable routes. May only be instantiated within this file. 7 * Class for navigable routes. May only be instantiated within this file.
8 * @constructor 8 * @constructor
9 * @param {string} path 9 * @param {string} path
10 * @private 10 * @private
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return true; 67 return true;
68 } 68 }
69 return false; 69 return false;
70 }, 70 },
71 71
72 /** 72 /**
73 * Returns true if this route is a subpage of a section. 73 * Returns true if this route is a subpage of a section.
74 * @return {boolean} 74 * @return {boolean}
75 */ 75 */
76 isSubpage: function() { 76 isSubpage: function() {
77 return !!this.parent && this.parent.section == this.section; 77 return !!this.parent && !!this.section &&
78 this.parent.section == this.section;
78 }, 79 },
79 }; 80 };
80 81
81 // Abbreviated variable for easier definitions. 82 // Abbreviated variable for easier definitions.
82 var r = Route; 83 var r = Route;
83 84
84 // Root pages. 85 // Root pages.
85 r.BASIC = new Route('/'); 86 r.BASIC = new Route('/');
86 r.ADVANCED = new Route('/advanced'); 87 r.ADVANCED = new Route('/advanced');
87 r.ABOUT = new Route('/help'); 88 r.ABOUT = new Route('/help');
(...skipping 29 matching lines...) Expand all
117 r.POINTERS = r.DEVICE.createChild('/pointer-overlay'); 118 r.POINTERS = r.DEVICE.createChild('/pointer-overlay');
118 r.KEYBOARD = r.DEVICE.createChild('/keyboard-overlay'); 119 r.KEYBOARD = r.DEVICE.createChild('/keyboard-overlay');
119 r.DISPLAY = r.DEVICE.createChild('/display'); 120 r.DISPLAY = r.DEVICE.createChild('/display');
120 r.NOTES = r.DEVICE.createChild('/note'); 121 r.NOTES = r.DEVICE.createChild('/note');
121 </if> 122 </if>
122 123
123 r.PRIVACY = r.ADVANCED.createSection('/privacy', 'privacy'); 124 r.PRIVACY = r.ADVANCED.createSection('/privacy', 'privacy');
124 r.CERTIFICATES = r.PRIVACY.createChild('/certificates'); 125 r.CERTIFICATES = r.PRIVACY.createChild('/certificates');
125 126
126 // CLEAR_BROWSER_DATA is the only navigable dialog route. It's the only child 127 // CLEAR_BROWSER_DATA is the only navigable dialog route. It's the only child
127 // of a section that's not a subpage. Don't add any more routes like these. 128 // of a section that's not a subpage. Don't add any more routes like these.
michaelpg 2016/08/16 23:28:02 Update comment?
tommycli 2016/08/16 23:50:08 Done.
128 // If more navigable dialogs are needed, add explicit support in Route. 129 // If more navigable dialogs are needed, add explicit support in Route.
129 r.CLEAR_BROWSER_DATA = r.PRIVACY.createChild('/clearBrowserData'); 130 r.CLEAR_BROWSER_DATA = r.ADVANCED.createChild('/clearBrowserData');
130 r.CLEAR_BROWSER_DATA.isSubpage = function() { return false; };
131 131
132 r.SITE_SETTINGS = r.PRIVACY.createChild('/siteSettings'); 132 r.SITE_SETTINGS = r.PRIVACY.createChild('/siteSettings');
133 r.SITE_SETTINGS_ALL = r.SITE_SETTINGS.createChild('all'); 133 r.SITE_SETTINGS_ALL = r.SITE_SETTINGS.createChild('all');
134 r.SITE_SETTINGS_ALL_DETAILS = r.SITE_SETTINGS_ALL.createChild('details'); 134 r.SITE_SETTINGS_ALL_DETAILS = r.SITE_SETTINGS_ALL.createChild('details');
135 135
136 r.SITE_SETTINGS_HANDLERS = r.SITE_SETTINGS.createChild('handlers'); 136 r.SITE_SETTINGS_HANDLERS = r.SITE_SETTINGS.createChild('handlers');
137 137
138 // TODO(tommycli): Find a way to refactor these repetitive category routes. 138 // TODO(tommycli): Find a way to refactor these repetitive category routes.
139 r.SITE_SETTINGS_AUTOMATIC_DOWNLOADS = 139 r.SITE_SETTINGS_AUTOMATIC_DOWNLOADS =
140 r.SITE_SETTINGS.createChild('automaticDownloads'); 140 r.SITE_SETTINGS.createChild('automaticDownloads');
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return { 349 return {
350 Route: Route, 350 Route: Route,
351 RouteObserverBehavior: RouteObserverBehavior, 351 RouteObserverBehavior: RouteObserverBehavior,
352 getRouteForPath: getRouteForPath, 352 getRouteForPath: getRouteForPath,
353 initializeRouteFromUrl: initializeRouteFromUrl, 353 initializeRouteFromUrl: initializeRouteFromUrl,
354 getCurrentRoute: getCurrentRoute, 354 getCurrentRoute: getCurrentRoute,
355 getQueryParameters: getQueryParameters, 355 getQueryParameters: getQueryParameters,
356 navigateTo: navigateTo, 356 navigateTo: navigateTo,
357 }; 357 };
358 }); 358 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698