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

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

Issue 2503983002: MD History: Focus item checkbox when selecting/deselecting on click (Closed)
Patch Set: Add a test Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 5 /**
6 * @param {!Element} root 6 * @param {!Element} root
7 * @param {?Element} boundary 7 * @param {?Element} boundary
8 * @param {cr.ui.FocusRow.Delegate} delegate 8 * @param {cr.ui.FocusRow.Delegate} delegate
9 * @constructor 9 * @constructor
10 * @extends {cr.ui.FocusRow} 10 * @extends {cr.ui.FocusRow}
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 var elem = e.path[i]; 178 var elem = e.path[i];
179 if (elem.id != 'checkbox' && 179 if (elem.id != 'checkbox' &&
180 (elem.nodeName == 'A' || elem.nodeName == 'BUTTON')) { 180 (elem.nodeName == 'A' || elem.nodeName == 'BUTTON')) {
181 return; 181 return;
182 } 182 }
183 } 183 }
184 184
185 if (this.selectionNotAllowed_()) 185 if (this.selectionNotAllowed_())
186 return; 186 return;
187 187
188 this.$.checkbox.focus();
188 this.fire('history-checkbox-select', { 189 this.fire('history-checkbox-select', {
189 element: this, 190 element: this,
190 shiftKey: e.shiftKey, 191 shiftKey: e.shiftKey,
191 }); 192 });
192 }, 193 },
193 194
194 /** 195 /**
195 * @param {MouseEvent} e 196 * @param {MouseEvent} e
196 * @private 197 * @private
197 */ 198 */
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 * @return {string} The title for a page of search results. 348 * @return {string} The title for a page of search results.
348 */ 349 */
349 HistoryItem.searchResultsTitle = function(numberOfResults, searchTerm) { 350 HistoryItem.searchResultsTitle = function(numberOfResults, searchTerm) {
350 var resultId = numberOfResults == 1 ? 'searchResult' : 'searchResults'; 351 var resultId = numberOfResults == 1 ? 'searchResult' : 'searchResults';
351 return loadTimeData.getStringF('foundSearchResults', numberOfResults, 352 return loadTimeData.getStringF('foundSearchResults', numberOfResults,
352 loadTimeData.getString(resultId), searchTerm); 353 loadTimeData.getString(resultId), searchTerm);
353 }; 354 };
354 355
355 return { HistoryItem: HistoryItem }; 356 return { HistoryItem: HistoryItem };
356 }); 357 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/app.crisper.js ('k') | chrome/test/data/webui/md_history/history_item_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698