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

Unified Diff: chrome/browser/resources/md_history/app.js

Issue 2456783006: MD History: fix script errors when navigating to /syncedTabs (or refreshing) (Closed)
Patch Set: found one more stale dep Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/md_history/app.html ('k') | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index 7cc406ef400055dc7b2de60a0eed8bbc1c8ca686..c0dbb18a500611cfc0f8a7e112cfe6348a483d02 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -24,7 +24,6 @@ Polymer({
behaviors: [
Polymer.IronScrollTargetBehavior,
- WebUIListenerBehavior,
],
properties: {
@@ -117,12 +116,6 @@ Polymer({
document.addEventListener('command', this.onCommand_.bind(this));
},
- /** @override */
- attached: function() {
- this.addWebUIListener('sign-in-state-updated',
- this.updateSignInState.bind(this));
- },
-
onFirstRender: function() {
setTimeout(function() {
chrome.send(
@@ -259,8 +252,11 @@ Polymer({
var syncedDeviceManagerElem =
/** @type {HistorySyncedDeviceManagerElement} */this
.$$('history-synced-device-manager');
- if (syncedDeviceManagerElem)
- syncedDeviceManagerElem.tabSyncDisabled();
+ if (syncedDeviceManagerElem) {
+ md_history.ensureLazyLoaded().then(function() {
+ syncedDeviceManagerElem.tabSyncDisabled();
+ });
+ }
return;
}
@@ -326,13 +322,15 @@ Polymer({
// This allows the synced-device-manager to render so that it can be set as
// the scroll target.
requestAnimationFrame(function() {
- // <iron-pages> can occasionally end up with no item selected during
- // tests.
- if (!this.$.content.selectedItem)
- return;
- this.scrollTarget =
- this.$.content.selectedItem.getContentScrollTarget();
- this._scrollHandler();
+ md_history.ensureLazyLoaded().then(function() {
+ // <iron-pages> can occasionally end up with no item selected during
+ // tests.
+ if (!this.$.content.selectedItem)
+ return;
+ this.scrollTarget =
+ this.$.content.selectedItem.getContentScrollTarget();
+ this._scrollHandler();
+ }.bind(this));
}.bind(this));
this.recordHistoryPageView_();
},
« no previous file with comments | « chrome/browser/resources/md_history/app.html ('k') | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698