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

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

Issue 2361513003: MD History: Update sign in state in data source (Closed)
Patch Set: try another approach Created 4 years, 2 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 function PromiseResolver() { 4 function PromiseResolver() {
5 this.resolve_; 5 this.resolve_;
6 this.reject_; 6 this.reject_;
7 this.promise_ = new Promise(function(resolve, reject) { 7 this.promise_ = new Promise(function(resolve, reject) {
8 this.resolve_ = resolve; 8 this.resolve_ = resolve;
9 this.reject_ = reject; 9 this.reject_ = reject;
10 }.bind(this)); 10 }.bind(this));
(...skipping 5313 matching lines...) Expand 10 before | Expand all | Expand 10 after
5324 } 5324 }
5325 return lazyLoadPromise; 5325 return lazyLoadPromise;
5326 } 5326 }
5327 return { 5327 return {
5328 ensureLazyLoaded: ensureLazyLoaded 5328 ensureLazyLoaded: ensureLazyLoaded
5329 }; 5329 };
5330 }); 5330 });
5331 5331
5332 Polymer({ 5332 Polymer({
5333 is: 'history-app', 5333 is: 'history-app',
5334 behaviors: [ Polymer.IronScrollTargetBehavior ], 5334 behaviors: [ Polymer.IronScrollTargetBehavior, WebUIListenerBehavior ],
5335 properties: { 5335 properties: {
5336 showSidebarFooter: Boolean, 5336 showSidebarFooter: Boolean,
5337 hasSyncedResults: Boolean, 5337 hasSyncedResults: Boolean,
5338 selectedPage_: { 5338 selectedPage_: {
5339 type: String, 5339 type: String,
5340 observer: 'selectedPageChanged_' 5340 observer: 'selectedPageChanged_'
5341 }, 5341 },
5342 grouped_: { 5342 grouped_: {
5343 type: Boolean, 5343 type: Boolean,
5344 reflectToAttribute: true 5344 reflectToAttribute: true
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
5390 'delete-selected': 'deleteSelected', 5390 'delete-selected': 'deleteSelected',
5391 'history-close-drawer': 'closeDrawer_', 5391 'history-close-drawer': 'closeDrawer_',
5392 'history-view-changed': 'historyViewChanged_' 5392 'history-view-changed': 'historyViewChanged_'
5393 }, 5393 },
5394 ready: function() { 5394 ready: function() {
5395 this.grouped_ = loadTimeData.getBoolean('groupByDomain'); 5395 this.grouped_ = loadTimeData.getBoolean('groupByDomain');
5396 cr.ui.decorate('command', cr.ui.Command); 5396 cr.ui.decorate('command', cr.ui.Command);
5397 document.addEventListener('canExecute', this.onCanExecute_.bind(this)); 5397 document.addEventListener('canExecute', this.onCanExecute_.bind(this));
5398 document.addEventListener('command', this.onCommand_.bind(this)); 5398 document.addEventListener('command', this.onCommand_.bind(this));
5399 }, 5399 },
5400 attached: function() {
5401 this.addWebUIListener('sign-in-state-updated', this.updateSignInState.bind(t his));
5402 },
5400 onFirstRender: function() { 5403 onFirstRender: function() {
5401 setTimeout(function() { 5404 setTimeout(function() {
5402 chrome.send('metricsHandler:recordTime', [ 'History.ResultsRenderedTime', window.performance.now() ]); 5405 chrome.send('metricsHandler:recordTime', [ 'History.ResultsRenderedTime', window.performance.now() ]);
5403 }); 5406 });
5404 if (!this.hasDrawer_) { 5407 if (!this.hasDrawer_) {
5405 this.focusToolbarSearchField(); 5408 this.focusToolbarSearchField();
5406 } 5409 }
5407 md_history.ensureLazyLoaded(); 5410 md_history.ensureLazyLoaded();
5408 }, 5411 },
5409 _scrollHandler: function() { 5412 _scrollHandler: function() {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
5517 5520
5518 case HistoryRange.MONTH: 5521 case HistoryRange.MONTH:
5519 histogramValue = HistoryPageViewHistogram.GROUPED_MONTH; 5522 histogramValue = HistoryPageViewHistogram.GROUPED_MONTH;
5520 break; 5523 break;
5521 } 5524 }
5522 break; 5525 break;
5523 } 5526 }
5524 md_history.BrowserService.getInstance().recordHistogram('History.HistoryPage View', histogramValue, HistoryPageViewHistogram.END); 5527 md_history.BrowserService.getInstance().recordHistogram('History.HistoryPage View', histogramValue, HistoryPageViewHistogram.END);
5525 } 5528 }
5526 }); 5529 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698