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

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

Issue 1919183005: Cleanup: Extract icon related methods outside of util.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename favicon.html to icon.html Created 4 years, 7 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-item', 6 is: 'history-item',
7 7
8 properties: { 8 properties: {
9 // Underlying HistoryEntry data for this item. Contains read-only fields 9 // Underlying HistoryEntry data for this item. Contains read-only fields
10 // from the history backend, as well as fields computed by history-list. 10 // from the history backend, as well as fields computed by history-list.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Stops the 'tap' event from closing the menu when it opens. 80 // Stops the 'tap' event from closing the menu when it opens.
81 e.stopPropagation(); 81 e.stopPropagation();
82 }, 82 },
83 83
84 /** 84 /**
85 * Set the favicon image, based on the URL of the history item. 85 * Set the favicon image, based on the URL of the history item.
86 * @private 86 * @private
87 */ 87 */
88 showIcon_: function() { 88 showIcon_: function() {
89 this.$.icon.style.backgroundImage = 89 this.$.icon.style.backgroundImage =
90 getFaviconImageSet(this.item.url); 90 cr.icon.getFaviconImageSet(this.item.url);
91 }, 91 },
92 92
93 /** 93 /**
94 * Updates the page title. If the result was from a search, highlights any 94 * Updates the page title. If the result was from a search, highlights any
95 * occurrences of the search term in bold. 95 * occurrences of the search term in bold.
96 * @private 96 * @private
97 */ 97 */
98 setSearchedTextToBold_: function() { 98 setSearchedTextToBold_: function() {
99 var i = 0; 99 var i = 0;
100 var titleElem = this.$.title; 100 var titleElem = this.$.title;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 */ 135 */
136 cardTitle_: function(numberOfItems, historyDate, search) { 136 cardTitle_: function(numberOfItems, historyDate, search) {
137 if (!search) 137 if (!search)
138 return this.item.dateRelativeDay; 138 return this.item.dateRelativeDay;
139 139
140 var resultId = numberOfItems == 1 ? 'searchResult' : 'searchResults'; 140 var resultId = numberOfItems == 1 ? 'searchResult' : 'searchResults';
141 return loadTimeData.getStringF('foundSearchResults', numberOfItems, 141 return loadTimeData.getStringF('foundSearchResults', numberOfItems,
142 loadTimeData.getString(resultId), search); 142 loadTimeData.getString(resultId), search);
143 } 143 }
144 }); 144 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698