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

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

Issue 1648803003: MD History: Drop-down menu allows searching for history-items by domain name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@search_functionality
Patch Set: Created 4 years, 10 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 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 Polymer({ 5 Polymer({
6 is: 'history-toolbar', 6 is: 'history-toolbar',
7 properties: { 7 properties: {
8 // Number of history items currently selected. 8 // Number of history items currently selected.
9 count: { 9 count: {
10 type: Number, 10 type: Number,
(...skipping 18 matching lines...) Expand all
29 /** 29 /**
30 * Changes the toolbar background color depending on whether any history items 30 * Changes the toolbar background color depending on whether any history items
31 * are currently selected. 31 * are currently selected.
32 * @private 32 * @private
33 */ 33 */
34 changeToolbarView_: function() { 34 changeToolbarView_: function() {
35 this.itemsSelected_ = this.count != 0; 35 this.itemsSelected_ = this.count != 0;
36 }, 36 },
37 37
38 /** 38 /**
39 * When using the drop-down "more from site" set the search bar to reflect the
40 * term that was searched.
41 */
42 setSearchTerm: function(search) {
43 this.searchTerm = search;
44 var searchBar = this.$$('#search-input');
45
46 searchBar.showAndFocus();
47 Polymer.dom.flush();
calamity 2016/02/03 05:09:13 Do we need this flush?
hsampson 2016/02/08 00:39:37 Yes otherwise we can't access the search input sec
48 searchBar.$$('#search-input').value = search;
49 },
50
51 /**
39 * If the search term has changed reload for the new search. 52 * If the search term has changed reload for the new search.
40 */ 53 */
41 onSearchTermSearch: function(searchTerm) { 54 onSearchTermSearch: function(searchTerm) {
42 if (searchTerm != this.searchTerm) 55 if (searchTerm != this.searchTerm)
43 this.fire('refresh-results', {search: searchTerm}); 56 this.fire('refresh-results', {search: searchTerm});
44 this.searchTerm = searchTerm; 57 this.searchTerm = searchTerm;
45 }, 58 },
46 59
47 attached: function() { 60 attached: function() {
48 this.async(function() { 61 this.async(function() {
(...skipping 15 matching lines...) Expand all
64 function ToolbarSearchFieldDelegate(toolbar) { 77 function ToolbarSearchFieldDelegate(toolbar) {
65 this.toolbar_ = toolbar; 78 this.toolbar_ = toolbar;
66 } 79 }
67 80
68 ToolbarSearchFieldDelegate.prototype = { 81 ToolbarSearchFieldDelegate.prototype = {
69 /** @override */ 82 /** @override */
70 onSearchTermSearch: function(searchTerm) { 83 onSearchTermSearch: function(searchTerm) {
71 this.toolbar_.onSearchTermSearch(searchTerm); 84 this.toolbar_.onSearchTermSearch(searchTerm);
72 } 85 }
73 }; 86 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698