OLD | NEW |
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 * @constructor | 6 * @constructor |
7 * @implements {SearchFieldDelegate} | 7 * @implements {SearchFieldDelegate} |
8 * @param {!HistoryToolbarElement} toolbar This history-toolbar. | 8 * @param {!HistoryToolbarElement} toolbar This history-toolbar. |
9 */ | 9 */ |
10 function ToolbarSearchFieldDelegate(toolbar) { | 10 function ToolbarSearchFieldDelegate(toolbar) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 attached: function() { | 87 attached: function() { |
88 this.searchFieldDelegate_ = new ToolbarSearchFieldDelegate(this); | 88 this.searchFieldDelegate_ = new ToolbarSearchFieldDelegate(this); |
89 /** @type {SearchField} */(this.$['search-input']) | 89 /** @type {SearchField} */(this.$['search-input']) |
90 .setDelegate(this.searchFieldDelegate_); | 90 .setDelegate(this.searchFieldDelegate_); |
91 }, | 91 }, |
92 | 92 |
93 onClearSelectionTap_: function() { | 93 onClearSelectionTap_: function() { |
94 this.fire('unselect-all'); | 94 this.fire('unselect-all'); |
95 }, | 95 }, |
96 | 96 |
97 /** | |
98 * Relocates the user to the clear browsing data section of the settings page. | |
99 * @private | |
100 */ | |
101 onClearBrowsingDataTap_: function() { | |
102 window.location.href = 'chrome://settings/clearBrowserData'; | |
103 }, | |
104 | |
105 onDeleteTap_: function() { | 97 onDeleteTap_: function() { |
106 this.fire('delete-selected'); | 98 this.fire('delete-selected'); |
107 }, | 99 }, |
108 | 100 |
109 /** | 101 /** |
110 * If the user is a supervised user the delete button is not shown. | 102 * If the user is a supervised user the delete button is not shown. |
111 * @private | 103 * @private |
112 */ | 104 */ |
113 deletingAllowed_: function() { | 105 deletingAllowed_: function() { |
114 return loadTimeData.getBoolean('allowDeletingHistory'); | 106 return loadTimeData.getBoolean('allowDeletingHistory'); |
115 }, | 107 }, |
116 | 108 |
117 numberOfItemsSelected_: function(count) { | 109 numberOfItemsSelected_: function(count) { |
118 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; | 110 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; |
119 } | 111 } |
120 }); | 112 }); |
OLD | NEW |