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

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

Issue 2369823002: MD History: Focus the search field on load without 'showing' it (Closed)
Patch Set: Closure 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 5383 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/app.js ('k') | chrome/test/data/webui/md_history/history_toolbar_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698