| 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 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-ui' implements the UI for the Settings page. | 7 * 'settings-ui' implements the UI for the Settings page. |
| 8 * | 8 * |
| 9 * Example: | 9 * Example: |
| 10 * | 10 * |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 this.showAndroidApps_ = loadTimeData.valueExists('androidAppsAllowed') && | 159 this.showAndroidApps_ = loadTimeData.valueExists('androidAppsAllowed') && |
| 160 loadTimeData.getBoolean('androidAppsAllowed'); | 160 loadTimeData.getBoolean('androidAppsAllowed'); |
| 161 }, | 161 }, |
| 162 | 162 |
| 163 /** @private {?IntersectionObserver} */ | 163 /** @private {?IntersectionObserver} */ |
| 164 intersectionObserver_: null, | 164 intersectionObserver_: null, |
| 165 | 165 |
| 166 /** @override */ | 166 /** @override */ |
| 167 attached: function() { | 167 attached: function() { |
| 168 document.documentElement.classList.remove('loading'); |
| 169 |
| 168 setTimeout(function() { | 170 setTimeout(function() { |
| 169 chrome.send( | 171 chrome.send( |
| 170 'metricsHandler:recordTime', | 172 'metricsHandler:recordTime', |
| 171 ['Settings.TimeUntilInteractive', window.performance.now()]); | 173 ['Settings.TimeUntilInteractive', window.performance.now()]); |
| 172 }); | 174 }); |
| 175 |
| 173 // Preload bold Roboto so it doesn't load and flicker the first time used. | 176 // Preload bold Roboto so it doesn't load and flicker the first time used. |
| 174 document.fonts.load('bold 12px Roboto'); | 177 document.fonts.load('bold 12px Roboto'); |
| 175 settings.setGlobalScrollTarget(this.$.container); | 178 settings.setGlobalScrollTarget(this.$.container); |
| 176 | 179 |
| 177 // Setup drop shadow logic. | 180 // Setup drop shadow logic. |
| 178 var callback = function(entries) { | 181 var callback = function(entries) { |
| 179 assert(entries.length == 1); | 182 assert(entries.length == 1); |
| 180 this.$.dropShadow.classList.toggle( | 183 this.$.dropShadow.classList.toggle( |
| 181 'has-shadow', entries[0].intersectionRatio == 0); | 184 'has-shadow', entries[0].intersectionRatio == 0); |
| 182 }.bind(this); | 185 }.bind(this); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 onMenuButtonTap_: function() { | 265 onMenuButtonTap_: function() { |
| 263 this.$.drawer.toggle(); | 266 this.$.drawer.toggle(); |
| 264 }, | 267 }, |
| 265 | 268 |
| 266 /** @private */ | 269 /** @private */ |
| 267 directionDelegateChanged_: function() { | 270 directionDelegateChanged_: function() { |
| 268 this.$.drawer.align = this.directionDelegate.isRtl() ? | 271 this.$.drawer.align = this.directionDelegate.isRtl() ? |
| 269 'right' : 'left'; | 272 'right' : 'left'; |
| 270 }, | 273 }, |
| 271 }); | 274 }); |
| OLD | NEW |