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

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

Issue 2456783006: MD History: fix script errors when navigating to /syncedTabs (or refreshing) (Closed)
Patch Set: . 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 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 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(
11 'chrome://history/lazy_load.html', resolve, reject, true); 11 'chrome://history/lazy_load.html', resolve, reject, true);
12 }); 12 });
13 } 13 }
14 return lazyLoadPromise; 14 return lazyLoadPromise;
15 } 15 }
16 16
17 return { 17 return {
18 ensureLazyLoaded: ensureLazyLoaded, 18 ensureLazyLoaded: ensureLazyLoaded,
19 }; 19 };
20 }); 20 });
21 21
22 Polymer({ 22 Polymer({
23 is: 'history-app', 23 is: 'history-app',
24 24
25 behaviors: [ 25 behaviors: [
26 Polymer.IronScrollTargetBehavior, 26 Polymer.IronScrollTargetBehavior,
27 WebUIListenerBehavior, 27 WebUIListenerBehavior,
tsergeant 2016/11/02 22:30:46 Can this be removed now?
Dan Beam 2016/11/02 22:49:11 Done.
28 ], 28 ],
29 29
30 properties: { 30 properties: {
31 // Used to display notices for profile sign-in status. 31 // Used to display notices for profile sign-in status.
32 showSidebarFooter: Boolean, 32 showSidebarFooter: Boolean,
33 33
34 hasSyncedResults: Boolean, 34 hasSyncedResults: Boolean,
35 35
36 // The id of the currently selected page. 36 // The id of the currently selected page.
37 selectedPage_: {type: String, observer: 'selectedPageChanged_'}, 37 selectedPage_: {type: String, observer: 'selectedPageChanged_'},
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 /** @override */ 111 /** @override */
112 ready: function() { 112 ready: function() {
113 this.grouped_ = loadTimeData.getBoolean('groupByDomain'); 113 this.grouped_ = loadTimeData.getBoolean('groupByDomain');
114 114
115 cr.ui.decorate('command', cr.ui.Command); 115 cr.ui.decorate('command', cr.ui.Command);
116 document.addEventListener('canExecute', this.onCanExecute_.bind(this)); 116 document.addEventListener('canExecute', this.onCanExecute_.bind(this));
117 document.addEventListener('command', this.onCommand_.bind(this)); 117 document.addEventListener('command', this.onCommand_.bind(this));
118 }, 118 },
119 119
120 /** @override */
121 attached: function() {
122 this.addWebUIListener('sign-in-state-updated',
123 this.updateSignInState.bind(this));
124 },
125
126 onFirstRender: function() { 120 onFirstRender: function() {
127 setTimeout(function() { 121 setTimeout(function() {
128 chrome.send( 122 chrome.send(
129 'metricsHandler:recordTime', 123 'metricsHandler:recordTime',
130 ['History.ResultsRenderedTime', window.performance.now()]); 124 ['History.ResultsRenderedTime', window.performance.now()]);
131 }); 125 });
132 126
133 // Focus the search field on load. Done here to ensure the history page 127 // Focus the search field on load. Done here to ensure the history page
134 // is rendered before we try to take focus. 128 // is rendered before we try to take focus.
135 var searchField = 129 var searchField =
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 break; 372 break;
379 } 373 }
380 break; 374 break;
381 } 375 }
382 376
383 md_history.BrowserService.getInstance().recordHistogram( 377 md_history.BrowserService.getInstance().recordHistogram(
384 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END 378 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END
385 ); 379 );
386 }, 380 },
387 }); 381 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_downloads/crisper.js ('k') | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698