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

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

Issue 2184863002: MD Settings: Remove paper-header-panel, use IntersectionObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve conflicts Created 3 years, 8 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/settings_ui/settings_ui.html ('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 * @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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 googleDrive: false, 153 googleDrive: false,
154 }, 154 },
155 // </if> 155 // </if>
156 }; 156 };
157 } 157 }
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} */
164 intersectionObserver_: null,
165
163 /** @override */ 166 /** @override */
164 attached: function() { 167 attached: function() {
165 setTimeout(function() { 168 setTimeout(function() {
166 chrome.send( 169 chrome.send(
167 'metricsHandler:recordTime', 170 'metricsHandler:recordTime',
168 ['Settings.TimeUntilInteractive', window.performance.now()]); 171 ['Settings.TimeUntilInteractive', window.performance.now()]);
169 }); 172 });
170 // Preload bold Roboto so it doesn't load and flicker the first time used. 173 // Preload bold Roboto so it doesn't load and flicker the first time used.
171 document.fonts.load('bold 12px Roboto'); 174 document.fonts.load('bold 12px Roboto');
172 settings.setGlobalScrollTarget(this.$.headerPanel.scroller); 175 settings.setGlobalScrollTarget(this.$.container);
176
177 // Setup drop shadow logic.
178 var callback = function(entries) {
179 assert(entries.length == 1);
180 this.$.dropShadow.classList.toggle(
181 'has-shadow', entries[0].intersectionRatio == 0);
182 }.bind(this);
183
184 this.intersectionObserver_ = new IntersectionObserver(
185 callback,
186 /** @type {IntersectionObserverInit} */ ({
187 root: this.$.container,
188 threshold: 0,
189 }));
190 this.intersectionObserver_.observe(this.$.intersectionProbe);
173 }, 191 },
174 192
175 /** @override */ 193 /** @override */
176 detached: function() { 194 detached: function() {
177 settings.resetRouteForTesting(); 195 settings.resetRouteForTesting();
196 this.intersectionObserver_.disconnect();
197 this.intersectionObserver_ = null;
178 }, 198 },
179 199
180 /** @param {!settings.Route} route */ 200 /** @param {!settings.Route} route */
181 currentRouteChanged: function(route) { 201 currentRouteChanged: function(route) {
182 var urlSearchQuery = settings.getQueryParameters().get('search') || ''; 202 var urlSearchQuery = settings.getQueryParameters().get('search') || '';
183 if (urlSearchQuery == this.lastSearchQuery_) 203 if (urlSearchQuery == this.lastSearchQuery_)
184 return; 204 return;
185 205
186 this.lastSearchQuery_ = urlSearchQuery; 206 this.lastSearchQuery_ = urlSearchQuery;
187 207
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 onMenuButtonTap_: function() { 262 onMenuButtonTap_: function() {
243 this.$.drawer.toggle(); 263 this.$.drawer.toggle();
244 }, 264 },
245 265
246 /** @private */ 266 /** @private */
247 directionDelegateChanged_: function() { 267 directionDelegateChanged_: function() {
248 this.$.drawer.align = this.directionDelegate.isRtl() ? 268 this.$.drawer.align = this.directionDelegate.isRtl() ?
249 'right' : 'left'; 269 'right' : 'left';
250 }, 270 },
251 }); 271 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/settings_ui/settings_ui.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698