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

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

Issue 2166263002: MD History: Make the forward slash key to rely on focused only (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // The id of the currently selected page. 9 // The id of the currently selected page.
10 selectedPage_: {type: String, value: 'history', observer: 'unselectAll'}, 10 selectedPage_: {type: String, value: 'history', observer: 'unselectAll'},
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 * @param {Event} e 148 * @param {Event} e
149 * @private 149 * @private
150 */ 150 */
151 onCanExecute_: function(e) { 151 onCanExecute_: function(e) {
152 e = /** @type {cr.ui.CanExecuteEvent} */(e); 152 e = /** @type {cr.ui.CanExecuteEvent} */(e);
153 switch (e.command.id) { 153 switch (e.command.id) {
154 case 'find-command': 154 case 'find-command':
155 e.canExecute = true; 155 e.canExecute = true;
156 break; 156 break;
157 case 'slash-command': 157 case 'slash-command':
158 e.canExecute = 158 e.canExecute = !this.$.toolbar.searchBar.isSearchFocused();
159 !(this.$.toolbar.searchBar.showingSearch &&
160 this.$.toolbar.searchBar.isSearchFocused());
161 break; 159 break;
162 case 'delete-command': 160 case 'delete-command':
163 e.canExecute = this.$.toolbar.count > 0; 161 e.canExecute = this.$.toolbar.count > 0;
164 break; 162 break;
165 } 163 }
166 }, 164 },
167 165
168 /** 166 /**
169 * @param {string} searchTerm 167 * @param {string} searchTerm
170 * @private 168 * @private
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 * added as a child of iron-pages. 258 * added as a child of iron-pages.
261 * @param {string} selectedPage 259 * @param {string} selectedPage
262 * @param {Array} items 260 * @param {Array} items
263 * @return {string} 261 * @return {string}
264 * @private 262 * @private
265 */ 263 */
266 getSelectedPage_(selectedPage, items) { 264 getSelectedPage_(selectedPage, items) {
267 return selectedPage; 265 return selectedPage;
268 }, 266 },
269 }); 267 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698