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

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

Issue 2242863002: Settings Router Refactor: Allow no-op navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « chrome/browser/resources/settings/route.js ('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 * @typedef {{about: boolean, basic: boolean, advanced: boolean}} 6 * @typedef {{about: boolean, basic: boolean, advanced: boolean}}
7 */ 7 */
8 var MainPageVisibility; 8 var MainPageVisibility;
9 9
10 /** 10 /**
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 /** @private */ 197 /** @private */
198 toggleAdvancedPage_: function() { 198 toggleAdvancedPage_: function() {
199 this.fire('toggle-advanced-page', !this.advancedToggleExpanded_); 199 this.fire('toggle-advanced-page', !this.advancedToggleExpanded_);
200 }, 200 },
201 201
202 /** 202 /**
203 * Navigates to the default search page (if necessary). 203 * Navigates to the default search page (if necessary).
204 * @private 204 * @private
205 */ 205 */
206 ensureInDefaultSearchPage_: function() { 206 ensureInDefaultSearchPage_: function() {
207 settings.navigateTo(settings.Route.BASIC); 207 if (settings.getCurrentRoute() != settings.Route.BASIC)
208 settings.navigateTo(settings.Route.BASIC);
208 }, 209 },
209 210
210 /** 211 /**
211 * @param {string} query 212 * @param {string} query
212 * @return {!Promise} A promise indicating that searching finished. 213 * @return {!Promise} A promise indicating that searching finished.
213 */ 214 */
214 searchContents: function(query) { 215 searchContents: function(query) {
215 if (!this.previousShowPages_) { 216 if (!this.previousShowPages_) {
216 // Store which pages are shown before search, so that they can be restored 217 // Store which pages are shown before search, so that they can be restored
217 // after the user clears the search results. 218 // after the user clears the search results.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 260
260 /** 261 /**
261 * @param {(boolean|undefined)} visibility 262 * @param {(boolean|undefined)} visibility
262 * @return {boolean} True unless visibility is false. 263 * @return {boolean} True unless visibility is false.
263 * @private 264 * @private
264 */ 265 */
265 showAdvancedSettings_: function(visibility) { 266 showAdvancedSettings_: function(visibility) {
266 return visibility !== false; 267 return visibility !== false;
267 }, 268 },
268 }); 269 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/route.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698