| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |