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

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

Issue 2237703004: [MD History] Focus the search bar on load. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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 Polymer({ 5 Polymer({
6 is: 'history-app', 6 is: 'history-app',
7 7
8 properties: { 8 properties: {
9 showSidebarFooter: Boolean, 9 showSidebarFooter: Boolean,
10 10
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 historyResult: function(info, results) { 135 historyResult: function(info, results) {
136 this.set('queryState_.querying', false); 136 this.set('queryState_.querying', false);
137 this.set('queryResult_.info', info); 137 this.set('queryResult_.info', info);
138 this.set('queryResult_.results', results); 138 this.set('queryResult_.results', results);
139 var listContainer = 139 var listContainer =
140 /** @type {HistoryListContainerElement} */ (this.$['history']); 140 /** @type {HistoryListContainerElement} */ (this.$['history']);
141 listContainer.historyResult(info, results); 141 listContainer.historyResult(info, results);
142 }, 142 },
143 143
144 /** 144 /**
145 * Focuses the search bar in the toolbar.
146 */
147 focusToolbarSearchField: function() {
148 this.$.toolbar.showSearchField();
149 },
150
151 /**
145 * Fired when the user presses 'More from this site'. 152 * Fired when the user presses 'More from this site'.
146 * @param {{detail: {domain: string}}} e 153 * @param {{detail: {domain: string}}} e
147 */ 154 */
148 searchDomain_: function(e) { this.$.toolbar.setSearchTerm(e.detail.domain); }, 155 searchDomain_: function(e) { this.$.toolbar.setSearchTerm(e.detail.domain); },
149 156
150 /** 157 /**
151 * @param {Event} e 158 * @param {Event} e
152 * @private 159 * @private
153 */ 160 */
154 onCanExecute_: function(e) { 161 onCanExecute_: function(e) {
(...skipping 27 matching lines...) Expand all
182 searchQueryParamChanged_: function(searchQuery) { 189 searchQueryParamChanged_: function(searchQuery) {
183 this.$.toolbar.setSearchTerm(searchQuery || ''); 190 this.$.toolbar.setSearchTerm(searchQuery || '');
184 }, 191 },
185 192
186 /** 193 /**
187 * @param {Event} e 194 * @param {Event} e
188 * @private 195 * @private
189 */ 196 */
190 onCommand_: function(e) { 197 onCommand_: function(e) {
191 if (e.command.id == 'find-command' || e.command.id == 'slash-command') 198 if (e.command.id == 'find-command' || e.command.id == 'slash-command')
192 this.$.toolbar.showSearchField(); 199 this.focusToolbarSearchField();
193 if (e.command.id == 'delete-command') 200 if (e.command.id == 'delete-command')
194 this.deleteSelected(); 201 this.deleteSelected();
195 }, 202 },
196 203
197 /** 204 /**
198 * @param {!Array<!ForeignSession>} sessionList Array of objects describing 205 * @param {!Array<!ForeignSession>} sessionList Array of objects describing
199 * the sessions from other devices. 206 * the sessions from other devices.
200 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile? 207 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile?
201 */ 208 */
202 setForeignSessions: function(sessionList, isTabSyncEnabled) { 209 setForeignSessions: function(sessionList, isTabSyncEnabled) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 /** 271 /**
265 * This computed binding is needed to make the iron-pages selector update when 272 * This computed binding is needed to make the iron-pages selector update when
266 * the synced-device-manager is instantiated for the first time. Otherwise the 273 * the synced-device-manager is instantiated for the first time. Otherwise the
267 * fallback selection will continue to be used after the corresponding item is 274 * fallback selection will continue to be used after the corresponding item is
268 * added as a child of iron-pages. 275 * added as a child of iron-pages.
269 * @param {string} selectedPage 276 * @param {string} selectedPage
270 * @param {Array} items 277 * @param {Array} items
271 * @return {string} 278 * @return {string}
272 * @private 279 * @private
273 */ 280 */
274 getSelectedPage_(selectedPage, items) { 281 getSelectedPage_: function(selectedPage, items) {
275 return selectedPage; 282 return selectedPage;
276 }, 283 },
277 284
278 /** @private */ 285 /** @private */
279 closeDrawer_: function() { 286 closeDrawer_: function() {
280 var drawer = this.$$('#drawer'); 287 var drawer = this.$$('#drawer');
281 if (drawer) 288 if (drawer)
282 drawer.close(); 289 drawer.close();
283 }, 290 },
284 }); 291 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698