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

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

Issue 2184893002: Settings Router Refactor: Remove route.page legacy property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0217-settings-refactor-settings-menu
Patch Set: 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 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-main' displays the selected settings page. 7 * 'settings-main' displays the selected settings page.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-main', 10 is: 'settings-main',
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 return showBasicPage && !inSubpage; 105 return showBasicPage && !inSubpage;
106 }, 106 },
107 107
108 /** 108 /**
109 * @private 109 * @private
110 */ 110 */
111 currentRouteChanged_: function(newRoute) { 111 currentRouteChanged_: function(newRoute) {
112 this.inSubpage_ = newRoute.subpage.length > 0; 112 this.inSubpage_ = newRoute.subpage.length > 0;
113 this.style.height = this.inSubpage_ ? '100%' : ''; 113 this.style.height = this.inSubpage_ ? '100%' : '';
114 114
115 if (newRoute.page == 'about') { 115 if (newRoute.inSubtreeOf(settings.Route.ABOUT)) {
michaelpg 2016/07/28 23:22:32 so, what we care about is what is the *root* of ne
tommycli 2016/07/29 00:03:35 So... I would create a 'root', except that we also
michaelpg 2016/07/29 00:21:12 in a later CL, you mean? Why do we want to get rid
michaelpg 2016/07/29 00:29:14 just realized I'm conflating .section and .subpage
tommycli 2016/07/29 18:23:43 Hey, I thought about the variety of things you sai
michaelpg 2016/07/29 20:28:53 "The contains(other) method must return true if ot
116 this.showPages_ = {about: true, basic: false, advanced: false}; 116 this.showPages_ = {about: true, basic: false, advanced: false};
117 } else { 117 } else {
118 this.showPages_ = { 118 this.showPages_ = {
119 about: false, 119 about: false,
120 basic: newRoute.page == 'basic' || !this.inSubpage_, 120 basic:
121 advanced: newRoute.page == 'advanced' || 121 newRoute.inSubtreeOf(settings.Route.BASIC) || !this.inSubpage_,
122 advanced: newRoute.inSubtreeOf(settings.Route.ADVANCED) ||
122 (!this.inSubpage_ && this.advancedToggleExpanded_), 123 (!this.inSubpage_ && this.advancedToggleExpanded_),
123 }; 124 };
124 125
125 if (this.showPages_.advanced) 126 if (this.showPages_.advanced)
126 this.advancedToggleExpanded_ = true; 127 this.advancedToggleExpanded_ = true;
127 } 128 }
128 129
129 // Wait for the dom-if changes prior to calculating the overflow padding. 130 // Wait for the dom-if changes prior to calculating the overflow padding.
130 this.async(function() { 131 this.async(function() {
131 this.$.overscroll.style.paddingBottom = this.overscrollHeight_() + 'px'; 132 this.$.overscroll.style.paddingBottom = this.overscrollHeight_() + 'px';
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return; 215 return;
215 } 216 }
216 217
217 this.toolbarSpinnerActive = false; 218 this.toolbarSpinnerActive = false;
218 this.showNoResultsFound_ = 219 this.showNoResultsFound_ =
219 !request.isSame('') && !request.didFindMatches(); 220 !request.isSame('') && !request.didFindMatches();
220 }.bind(this)); 221 }.bind(this));
221 }.bind(this), 0); 222 }.bind(this), 0);
222 }, 223 },
223 }); 224 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698