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

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

Issue 2022003002: [MD History] Add search for synced devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@land_icons
Patch Set: address comments Created 4 years, 6 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 cr.define('md_history', function() { 5 cr.define('md_history', function() {
6 var HistoryItem = Polymer({ 6 var HistoryItem = Polymer({
7 is: 'history-item', 7 is: 'history-item',
8 8
9 properties: { 9 properties: {
10 // Underlying HistoryEntry data for this item. Contains read-only fields 10 // Underlying HistoryEntry data for this item. Contains read-only fields
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 showIcon_: function() { 62 showIcon_: function() {
63 this.$.icon.style.backgroundImage = 63 this.$.icon.style.backgroundImage =
64 cr.icon.getFaviconImageSet(this.item.url); 64 cr.icon.getFaviconImageSet(this.item.url);
65 }, 65 },
66 66
67 /** 67 /**
68 * Updates the page title. If the result was from a search, highlights any 68 * Updates the page title. If the result was from a search, highlights any
69 * occurrences of the search term in bold. 69 * occurrences of the search term in bold.
70 * @private 70 * @private
71 */ 71 */
72 // TODO(calamity): Pull this bolding behavior into a separate element for
73 // synced device search.
72 setSearchedTextToBold_: function() { 74 setSearchedTextToBold_: function() {
73 var i = 0; 75 var i = 0;
74 var titleElem = this.$.title; 76 var titleElem = this.$.title;
75 var titleText = this.item.title; 77 var titleText = this.item.title;
76 78
77 if (this.searchTerm == '' || this.searchTerm == null) { 79 if (this.searchTerm == '' || this.searchTerm == null) {
78 titleElem.textContent = titleText; 80 titleElem.textContent = titleText;
79 return; 81 return;
80 } 82 }
81 83
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 137
136 if (searchedTerm) 138 if (searchedTerm)
137 return currentItem.dateShort != nextItem.dateShort; 139 return currentItem.dateShort != nextItem.dateShort;
138 140
139 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && 141 return currentItem.time - nextItem.time > BROWSING_GAP_TIME &&
140 currentItem.dateRelativeDay == nextItem.dateRelativeDay; 142 currentItem.dateRelativeDay == nextItem.dateRelativeDay;
141 }; 143 };
142 144
143 return { HistoryItem: HistoryItem }; 145 return { HistoryItem: HistoryItem };
144 }); 146 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698