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

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

Issue 2237703004: [MD History] Focus the search bar on load. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/md_history/app.js ('k') | chrome/browser/resources/md_history/app.vulcanized.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/app.crisper.js
diff --git a/chrome/browser/resources/md_history/app.crisper.js b/chrome/browser/resources/md_history/app.crisper.js
index f89cd85d8fadf3e3baf8ec300691ab508b8f59b0..152f64d5ccdf54377af9da692b566dc9e55eaddc 100644
--- a/chrome/browser/resources/md_history/app.crisper.js
+++ b/chrome/browser/resources/md_history/app.crisper.js
@@ -8573,6 +8573,14 @@ Polymer({
window.location.href = window.location.href.split('#')[0] + '?' + window.location.hash.substr(1);
}
},
+ onFirstRender: function() {
+ requestAnimationFrame(function() {
+ chrome.send('metricsHandler:recordTime', [ 'History.ResultsRenderedTime', window.performance.now() ]);
+ });
+ if (!this.hasDrawer_) {
+ this.focusToolbarSearchField();
+ }
+ },
onMenuTap_: function() {
var drawer = this.$$('#drawer');
if (drawer) drawer.toggle();
@@ -8597,6 +8605,9 @@ Polymer({
var listContainer = this.$['history'];
listContainer.historyResult(info, results);
},
+ focusToolbarSearchField: function() {
+ this.$.toolbar.showSearchField();
+ },
searchDomain_: function(e) {
this.$.toolbar.setSearchTerm(e.detail.domain);
},
@@ -8624,7 +8635,7 @@ Polymer({
this.$.toolbar.setSearchTerm(searchQuery || '');
},
onCommand_: function(e) {
- if (e.command.id == 'find-command' || e.command.id == 'slash-command') this.$.toolbar.showSearchField();
+ if (e.command.id == 'find-command' || e.command.id == 'slash-command') this.focusToolbarSearchField();
if (e.command.id == 'delete-command') this.deleteSelected();
},
setForeignSessions: function(sessionList, isTabSyncEnabled) {
« no previous file with comments | « chrome/browser/resources/md_history/app.js ('k') | chrome/browser/resources/md_history/app.vulcanized.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698