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

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

Issue 2643533003: MD History: Use one-way binding for history query state. (Closed)
Patch Set: Remove wrapper function Created 3 years, 11 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 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-list-container', 6 is: 'history-list-container',
7 7
8 properties: { 8 properties: {
9 /** @type {HistoryRange} */
10 groupedRange: {
11 type: Number,
12 observer: 'groupedRangeChanged_',
13 },
14
15 // The path of the currently selected page. 9 // The path of the currently selected page.
16 selectedPage_: { 10 selectedPage_: {
17 type: String, 11 type: String,
18 computed: 'computeSelectedPage_(groupedRange)', 12 computed: 'computeSelectedPage_(queryState.range)',
19 }, 13 },
20 14
21 // Whether domain-grouped history is enabled. 15 // Whether domain-grouped history is enabled.
22 grouped: Boolean, 16 grouped: Boolean,
23 17
24 /** @type {!QueryState} */ 18 /** @type {!QueryState} */
25 queryState: Object, 19 queryState: Object,
26 20
27 /** @type {!QueryResult} */ 21 /** @type {!QueryResult} */
28 queryResult: Object, 22 queryResult: Object,
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 var menu = /** @type {CrSharedMenuElement} */ this.$.sharedMenu.get(); 194 var menu = /** @type {CrSharedMenuElement} */ this.$.sharedMenu.get();
201 menu.showAt(target); 195 menu.showAt(target);
202 }, 196 },
203 197
204 /** @private */ 198 /** @private */
205 onMoreFromSiteTap_: function() { 199 onMoreFromSiteTap_: function() {
206 md_history.BrowserService.getInstance().recordAction( 200 md_history.BrowserService.getInstance().recordAction(
207 'EntryMenuShowMoreFromSite'); 201 'EntryMenuShowMoreFromSite');
208 202
209 var menu = assert(this.$.sharedMenu.getIfExists()); 203 var menu = assert(this.$.sharedMenu.getIfExists());
210 this.set('queryState.searchTerm', this.actionMenuModel_.item.domain); 204 this.fire('change-query', {search: this.actionMenuModel_.item.domain});
211 this.actionMenuModel_ = null; 205 this.actionMenuModel_ = null;
212 this.closeMenu_(); 206 this.closeMenu_();
213 }, 207 },
214 208
215 /** @private */ 209 /** @private */
216 onRemoveFromHistoryTap_: function() { 210 onRemoveFromHistoryTap_: function() {
217 var browserService = md_history.BrowserService.getInstance(); 211 var browserService = md_history.BrowserService.getInstance();
218 browserService.recordAction('EntryMenuRemoveFromHistory'); 212 browserService.recordAction('EntryMenuRemoveFromHistory');
219 var menu = assert(this.$.sharedMenu.getIfExists()); 213 var menu = assert(this.$.sharedMenu.getIfExists());
220 var itemData = this.actionMenuModel_; 214 var itemData = this.actionMenuModel_;
(...skipping 29 matching lines...) Expand all
250 */ 244 */
251 getSelectedList_: function() { 245 getSelectedList_: function() {
252 return this.$$('#' + this.selectedPage_); 246 return this.$$('#' + this.selectedPage_);
253 }, 247 },
254 248
255 /** @private */ 249 /** @private */
256 canDeleteHistory_: function() { 250 canDeleteHistory_: function() {
257 return loadTimeData.getBoolean('allowDeletingHistory'); 251 return loadTimeData.getBoolean('allowDeletingHistory');
258 } 252 }
259 }); 253 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/list_container.html ('k') | chrome/browser/resources/md_history/query_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698