| 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 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 5383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 onFirstRender: function() { | 5400 onFirstRender: function() { |
| 5401 setTimeout(function() { | 5401 setTimeout(function() { |
| 5402 chrome.send('metricsHandler:recordTime', [ 'History.ResultsRenderedTime',
window.performance.now() ]); | 5402 chrome.send('metricsHandler:recordTime', [ 'History.ResultsRenderedTime',
window.performance.now() ]); |
| 5403 }); | 5403 }); |
| 5404 if (!this.hasDrawer_) { | 5404 var searchField = this.$.toolbar.searchField; |
| 5405 this.focusToolbarSearchField(); | 5405 if (!searchField.narrow) { |
| 5406 searchField.getSearchInput().focus(); |
| 5406 } | 5407 } |
| 5407 md_history.ensureLazyLoaded(); | 5408 md_history.ensureLazyLoaded(); |
| 5408 }, | 5409 }, |
| 5409 _scrollHandler: function() { | 5410 _scrollHandler: function() { |
| 5410 if (this.scrollTarget) this.toolbarShadow_ = this.scrollTarget.scrollTop !=
0; | 5411 if (this.scrollTarget) this.toolbarShadow_ = this.scrollTarget.scrollTop !=
0; |
| 5411 }, | 5412 }, |
| 5412 onMenuTap_: function() { | 5413 onMenuTap_: function() { |
| 5413 var drawer = this.$$('#drawer'); | 5414 var drawer = this.$$('#drawer'); |
| 5414 if (drawer) drawer.toggle(); | 5415 if (drawer) drawer.toggle(); |
| 5415 }, | 5416 }, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5517 | 5518 |
| 5518 case HistoryRange.MONTH: | 5519 case HistoryRange.MONTH: |
| 5519 histogramValue = HistoryPageViewHistogram.GROUPED_MONTH; | 5520 histogramValue = HistoryPageViewHistogram.GROUPED_MONTH; |
| 5520 break; | 5521 break; |
| 5521 } | 5522 } |
| 5522 break; | 5523 break; |
| 5523 } | 5524 } |
| 5524 md_history.BrowserService.getInstance().recordHistogram('History.HistoryPage
View', histogramValue, HistoryPageViewHistogram.END); | 5525 md_history.BrowserService.getInstance().recordHistogram('History.HistoryPage
View', histogramValue, HistoryPageViewHistogram.END); |
| 5525 } | 5526 } |
| 5526 }); | 5527 }); |
| OLD | NEW |