| 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, settings: boolean}} | 6 * @typedef {{about: boolean, settings: boolean}} |
| 7 */ | 7 */ |
| 8 var MainPageVisibility; | 8 var MainPageVisibility; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 value: false, | 69 value: false, |
| 70 notify: true, | 70 notify: true, |
| 71 }, | 71 }, |
| 72 | 72 |
| 73 /** | 73 /** |
| 74 * Dictionary defining page visibility. | 74 * Dictionary defining page visibility. |
| 75 * @type {!GuestModePageVisibility} | 75 * @type {!GuestModePageVisibility} |
| 76 */ | 76 */ |
| 77 pageVisibility: { | 77 pageVisibility: { |
| 78 type: Object, | 78 type: Object, |
| 79 value: function() { return {}; }, | 79 value: function() { |
| 80 return {}; |
| 81 }, |
| 80 }, | 82 }, |
| 81 | 83 |
| 82 showAndroidApps: Boolean, | 84 showAndroidApps: Boolean, |
| 83 }, | 85 }, |
| 84 | 86 |
| 85 /** @override */ | 87 /** @override */ |
| 86 attached: function() { | 88 attached: function() { |
| 87 this.listen(this, 'freeze-scroll', 'onFreezeScroll_'); | 89 this.listen(this, 'freeze-scroll', 'onFreezeScroll_'); |
| 88 this.listen(this, 'lazy-loaded', 'onLazyLoaded_'); | 90 this.listen(this, 'lazy-loaded', 'onLazyLoaded_'); |
| 89 }, | 91 }, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 this.updateOverscrollForPage_(); | 191 this.updateOverscrollForPage_(); |
| 190 }.bind(this)); | 192 }.bind(this)); |
| 191 }, | 193 }, |
| 192 | 194 |
| 193 /** | 195 /** |
| 194 * Calculates the necessary overscroll and sets the overscroll to that value | 196 * Calculates the necessary overscroll and sets the overscroll to that value |
| 195 * (at minimum). For the About page, this just zeroes the overscroll. | 197 * (at minimum). For the About page, this just zeroes the overscroll. |
| 196 * @private | 198 * @private |
| 197 */ | 199 */ |
| 198 updateOverscrollForPage_: function() { | 200 updateOverscrollForPage_: function() { |
| 199 if (this.showPages_.about) { | 201 if (this.showPages_.about || this.inSearchMode_) { |
| 200 // Set overscroll directly to remove any existing overscroll that | 202 // Set overscroll directly to remove any existing overscroll that |
| 201 // setOverscroll_ would otherwise preserve. | 203 // setOverscroll_ would otherwise preserve. |
| 202 this.overscroll_ = 0; | 204 this.overscroll_ = 0; |
| 203 return; | 205 return; |
| 204 } | 206 } |
| 205 this.setOverscroll_(this.overscrollHeight_()); | 207 this.setOverscroll_(this.overscrollHeight_()); |
| 206 }, | 208 }, |
| 207 | 209 |
| 208 /** | 210 /** |
| 209 * Return the height that the overscroll padding should be set to. | 211 * Return the height that the overscroll padding should be set to. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 text: this.showNoResultsFound_ ? | 283 text: this.showNoResultsFound_ ? |
| 282 loadTimeData.getString('searchNoResults') : | 284 loadTimeData.getString('searchNoResults') : |
| 283 loadTimeData.getStringF('searchResults', query) | 285 loadTimeData.getStringF('searchResults', query) |
| 284 }); | 286 }); |
| 285 } | 287 } |
| 286 }.bind(this)); | 288 }.bind(this)); |
| 287 }.bind(this), 0); | 289 }.bind(this), 0); |
| 288 }.bind(this)); | 290 }.bind(this)); |
| 289 }, | 291 }, |
| 290 }); | 292 }); |
| OLD | NEW |