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

Side by Side Diff: chrome/browser/resources/md_history/synced_device_manager.js

Issue 2341923005: MD WebUI: Make cr-lazy-render get() synchronous (Closed)
Patch Set: Simplify test more Created 4 years, 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 {{device: string, 6 * @typedef {{device: string,
7 * lastUpdateTime: string, 7 * lastUpdateTime: string,
8 * opened: boolean, 8 * opened: boolean,
9 * separatorIndexes: !Array<number>, 9 * separatorIndexes: !Array<number>,
10 * timestamp: number, 10 * timestamp: number,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 chrome.send('startSignInFlow'); 127 chrome.send('startSignInFlow');
128 }, 128 },
129 129
130 onListScroll_: function() { 130 onListScroll_: function() {
131 var menu = this.$.menu.getIfExists(); 131 var menu = this.$.menu.getIfExists();
132 if (menu) 132 if (menu)
133 menu.closeMenu(); 133 menu.closeMenu();
134 }, 134 },
135 135
136 onToggleMenu_: function(e) { 136 onToggleMenu_: function(e) {
137 this.$.menu.get().then(function(menu) { 137 var menu = this.$.menu.get();
michaelpg 2016/09/16 23:18:40 /** @type {CrSharedMenuElement} */
tsergeant 2016/09/19 00:39:18 Done.
138 menu.toggleMenu(e.detail.target, e.detail.tag); 138 menu.toggleMenu(e.detail.target, e.detail.tag);
139 if (menu.menuOpen) { 139 if (menu.menuOpen) {
140 md_history.BrowserService.getInstance().recordHistogram( 140 md_history.BrowserService.getInstance().recordHistogram(
141 SYNCED_TABS_HISTOGRAM_NAME, SyncedTabsHistogram.SHOW_SESSION_MENU, 141 SYNCED_TABS_HISTOGRAM_NAME, SyncedTabsHistogram.SHOW_SESSION_MENU,
142 SyncedTabsHistogram.LIMIT); 142 SyncedTabsHistogram.LIMIT);
143 } 143 }
144 });
145 }, 144 },
146 145
147 onOpenAllTap_: function() { 146 onOpenAllTap_: function() {
148 var menu = assert(this.$.menu.getIfExists()); 147 var menu = assert(this.$.menu.getIfExists());
149 var browserService = md_history.BrowserService.getInstance(); 148 var browserService = md_history.BrowserService.getInstance();
150 browserService.recordHistogram( 149 browserService.recordHistogram(
151 SYNCED_TABS_HISTOGRAM_NAME, SyncedTabsHistogram.OPEN_ALL, 150 SYNCED_TABS_HISTOGRAM_NAME, SyncedTabsHistogram.OPEN_ALL,
152 SyncedTabsHistogram.LIMIT); 151 SyncedTabsHistogram.LIMIT);
153 browserService.openForeignSessionAllTabs( 152 browserService.openForeignSessionAllTabs(
154 menu.itemData); 153 menu.itemData);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 // User signed in, show the loading message when querying for synced 281 // User signed in, show the loading message when querying for synced
283 // devices. 282 // devices.
284 this.fetchingSyncedTabs_ = true; 283 this.fetchingSyncedTabs_ = true;
285 }, 284 },
286 285
287 searchTermChanged: function(searchTerm) { 286 searchTermChanged: function(searchTerm) {
288 this.clearDisplayedSyncedDevices_(); 287 this.clearDisplayedSyncedDevices_();
289 this.updateSyncedDevices(this.sessionList); 288 this.updateSyncedDevices(this.sessionList);
290 } 289 }
291 }); 290 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/list_container.js ('k') | chrome/test/data/webui/cr_elements/cr_lazy_render_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698