| 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 | 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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |