Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 cr.define('md_history', function() { | 5 cr.define('md_history', function() { |
| 6 var lazyLoadPromise = null; | 6 var lazyLoadPromise = null; |
| 7 function ensureLazyLoaded() { | 7 function ensureLazyLoaded() { |
| 8 if (!lazyLoadPromise) { | 8 if (!lazyLoadPromise) { |
| 9 lazyLoadPromise = new Promise(function(resolve, reject) { | 9 lazyLoadPromise = new Promise(function(resolve, reject) { |
| 10 Polymer.Base.importHref( | 10 Polymer.Base.importHref( |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 onCommand_: function(e) { | 257 onCommand_: function(e) { |
| 258 if (e.command.id == 'find-command' || e.command.id == 'slash-command') | 258 if (e.command.id == 'find-command' || e.command.id == 'slash-command') |
| 259 this.focusToolbarSearchField(); | 259 this.focusToolbarSearchField(); |
| 260 if (e.command.id == 'delete-command') | 260 if (e.command.id == 'delete-command') |
| 261 this.deleteSelected(); | 261 this.deleteSelected(); |
| 262 }, | 262 }, |
| 263 | 263 |
| 264 /** | 264 /** |
| 265 * @param {!Array<!ForeignSession>} sessionList Array of objects describing | 265 * @param {!Array<!ForeignSession>} sessionList Array of objects describing |
| 266 * the sessions from other devices. | 266 * the sessions from other devices. |
| 267 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile? | |
| 268 */ | 267 */ |
| 269 setForeignSessions: function(sessionList, isTabSyncEnabled) { | 268 setForeignSessions: function(sessionList) { |
| 270 if (!isTabSyncEnabled) { | |
| 271 var syncedDeviceManagerElem = | |
| 272 /** @type {HistorySyncedDeviceManagerElement} */this | |
| 273 .$$('history-synced-device-manager'); | |
| 274 if (syncedDeviceManagerElem) { | |
| 275 md_history.ensureLazyLoaded().then(function() { | |
| 276 syncedDeviceManagerElem.tabSyncDisabled(); | |
|
calamity
2016/11/24 00:29:09
Delete this in synced_device_manager.js
skym
2016/11/29 18:30:55
Done.
| |
| 277 }); | |
| 278 } | |
| 279 return; | |
| 280 } | |
| 281 | |
| 282 this.set('queryResult_.sessionList', sessionList); | 269 this.set('queryResult_.sessionList', sessionList); |
| 283 }, | 270 }, |
| 284 | 271 |
| 285 /** | 272 /** |
| 286 * Called when browsing data is cleared. | 273 * Called when browsing data is cleared. |
| 287 */ | 274 */ |
| 288 historyDeleted: function() { | 275 historyDeleted: function() { |
| 289 this.$.history.historyDeleted(); | 276 this.$.history.historyDeleted(); |
| 290 }, | 277 }, |
| 291 | 278 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 break; | 382 break; |
| 396 } | 383 } |
| 397 break; | 384 break; |
| 398 } | 385 } |
| 399 | 386 |
| 400 md_history.BrowserService.getInstance().recordHistogram( | 387 md_history.BrowserService.getInstance().recordHistogram( |
| 401 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END | 388 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END |
| 402 ); | 389 ); |
| 403 }, | 390 }, |
| 404 }); | 391 }); |
| OLD | NEW |