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 Polymer({ | 5 Polymer({ |
6 is: 'history-app', | 6 is: 'history-app', |
7 | 7 |
8 properties: { | 8 properties: { |
9 // The id of the currently selected page. | 9 // The id of the currently selected page. |
10 selectedPage: { | 10 selectedPage: { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 if (info.finished) | 85 if (info.finished) |
86 list.disableResultLoading(); | 86 list.disableResultLoading(); |
87 }, | 87 }, |
88 | 88 |
89 /** | 89 /** |
90 * @param {!Array<!ForeignSession>} sessionList Array of objects describing | 90 * @param {!Array<!ForeignSession>} sessionList Array of objects describing |
91 * the sessions from other devices. | 91 * the sessions from other devices. |
92 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile? | 92 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile? |
93 */ | 93 */ |
94 setForeignSessions: function(sessionList, isTabSyncEnabled) { | 94 setForeignSessions: function(sessionList, isTabSyncEnabled) { |
| 95 if (!isTabSyncEnabled) |
| 96 return; |
| 97 |
95 // TODO(calamity): Add a 'no synced devices' message when sessions are | 98 // TODO(calamity): Add a 'no synced devices' message when sessions are |
96 // empty. | 99 // empty. |
97 this.$['history-side-bar'].hidden = !isTabSyncEnabled; | |
98 var syncedDeviceElem = this.$['history-synced-device-manager']; | 100 var syncedDeviceElem = this.$['history-synced-device-manager']; |
99 var syncedDeviceManager = | 101 var syncedDeviceManager = |
100 /** @type {HistorySyncedDeviceManagerElement} */(syncedDeviceElem); | 102 /** @type {HistorySyncedDeviceManagerElement} */(syncedDeviceElem); |
101 if (isTabSyncEnabled) { | 103 syncedDeviceManager.setSyncedHistory(sessionList); |
102 syncedDeviceManager.setSyncedHistory(sessionList); | |
103 /** @type {HistoryToolbarElement} */(this.$.toolbar).hasSidebar = true; | |
104 } | |
105 }, | 104 }, |
106 | 105 |
107 deleteComplete: function() { | 106 deleteComplete: function() { |
108 var historyList = /** @type {HistoryListElement} */(this.$['history-list']); | 107 var historyList = /** @type {HistoryListElement} */(this.$['history-list']); |
109 var toolbar = /** @type {HistoryToolbarElement} */(this.$.toolbar); | 108 var toolbar = /** @type {HistoryToolbarElement} */(this.$.toolbar); |
110 historyList.removeDeletedHistory(toolbar.count); | 109 historyList.removeDeletedHistory(toolbar.count); |
111 toolbar.count = 0; | 110 toolbar.count = 0; |
112 } | 111 } |
113 }); | 112 }); |
OLD | NEW |