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

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

Issue 2754563002: MD Settings: Lazy load the contents of the "advanced" settings. (Closed)
Patch Set: Address comment. Created 3 years, 9 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/route.js
diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js
index 7d02247ac41f455d75716f19944950db897666bd..5bfdd5958d8d0d895307f50a1875209cb7f7cae8 100644
--- a/chrome/browser/resources/settings/route.js
+++ b/chrome/browser/resources/settings/route.js
@@ -100,6 +100,14 @@ cr.define('settings', function() {
r.TRIGGERED_RESET_DIALOG =
r.ADVANCED.createChild('/triggeredResetProfileSettings');
+ var navigableDialogs = new Set([
+ r.CLEAR_BROWSER_DATA,
+ r.IMPORT_DATA,
+ r.RESET_DIALOG,
+ r.SIGN_OUT,
+ r.TRIGGERED_RESET_DIALOG,
+ ]);
tommycli 2017/03/21 16:44:57 the isNavigableDialog thing is fine. I may suggest
dpapad 2017/03/21 17:54:15 Done.
+
// <if expr="chromeos">
r.INTERNET = r.BASIC.createSection('/internet', 'internet');
r.INTERNET_NETWORKS = r.INTERNET.createChild('/networks');
@@ -397,6 +405,15 @@ cr.define('settings', function() {
new URLSearchParams(window.location.search), true);
});
+ /**
+ * @param {!Route}
Dan Beam 2017/03/21 08:16:12 @param {!Route} route
dpapad 2017/03/21 17:54:15 Done.
+ * @return {boolean} Whether the given route corresponds to a navigable
+ * dialog. Those routes don't belong to a "section".
+ */
+ function isNavigableDialog(route) {
+ return navigableDialogs.has(route);
+ }
+
return {
Route: Route,
RouteObserverBehavior: RouteObserverBehavior,
@@ -408,5 +425,6 @@ cr.define('settings', function() {
lastRouteChangeWasPopstate: lastRouteChangeWasPopstate,
navigateTo: navigateTo,
navigateToPreviousRoute: navigateToPreviousRoute,
+ isNavigableDialog: isNavigableDialog,
};
});

Powered by Google App Engine
This is Rietveld 408576698