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

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

Issue 2230003002: MD History: Add lazy-render element for simple lazy initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 * separatorIndexes: !Array<number>, 8 * separatorIndexes: !Array<number>,
9 * timestamp: number, 9 * timestamp: number,
10 * tabs: !Array<!ForeignSessionTab>, 10 * tabs: !Array<!ForeignSessionTab>,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 tag: session.tag, 111 tag: session.tag,
112 }; 112 };
113 }, 113 },
114 114
115 onSignInTap_: function() { 115 onSignInTap_: function() {
116 chrome.send('SyncSetupShowSetupUI'); 116 chrome.send('SyncSetupShowSetupUI');
117 chrome.send('SyncSetupStartSignIn', [false]); 117 chrome.send('SyncSetupStartSignIn', [false]);
118 }, 118 },
119 119
120 onToggleMenu_: function(e) { 120 onToggleMenu_: function(e) {
121 this.$.menu.toggleMenu(e.detail.target, e.detail.tag); 121 this.$.menu.get().then(function(menu) {
122 menu.toggleMenu(e.detail.target, e.detail.tag);
123 });
122 }, 124 },
123 125
124 onOpenAllTap_: function() { 126 onOpenAllTap_: function() {
127 var menu = assert(this.$.menu.getIfExists());
125 md_history.BrowserService.getInstance().openForeignSessionAllTabs( 128 md_history.BrowserService.getInstance().openForeignSessionAllTabs(
126 this.$.menu.itemData); 129 menu.itemData);
127 this.$.menu.closeMenu(); 130 menu.closeMenu();
128 }, 131 },
129 132
130 onDeleteSessionTap_: function() { 133 onDeleteSessionTap_: function() {
134 var menu = assert(this.$.menu.getIfExists());
131 md_history.BrowserService.getInstance().deleteForeignSession( 135 md_history.BrowserService.getInstance().deleteForeignSession(
132 this.$.menu.itemData); 136 menu.itemData);
133 this.$.menu.closeMenu(); 137 menu.closeMenu();
134 }, 138 },
135 139
136 /** @private */ 140 /** @private */
137 clearDisplayedSyncedDevices_: function() { 141 clearDisplayedSyncedDevices_: function() {
138 this.syncedDevices_ = []; 142 this.syncedDevices_ = [];
139 }, 143 },
140 144
141 /** 145 /**
142 * Decide whether or not should display no synced tabs message. 146 * Decide whether or not should display no synced tabs message.
143 * @param {boolean} signInState 147 * @param {boolean} signInState
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // User signed in, show the loading message when querying for synced 240 // User signed in, show the loading message when querying for synced
237 // devices. 241 // devices.
238 this.fetchingSyncedTabs_ = true; 242 this.fetchingSyncedTabs_ = true;
239 }, 243 },
240 244
241 searchTermChanged: function(searchTerm) { 245 searchTermChanged: function(searchTerm) {
242 this.clearDisplayedSyncedDevices_(); 246 this.clearDisplayedSyncedDevices_();
243 this.updateSyncedDevices(this.sessionList); 247 this.updateSyncedDevices(this.sessionList);
244 } 248 }
245 }); 249 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/synced_device_manager.html ('k') | chrome/browser/ui/webui/md_history_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698