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

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

Issue 2962133002: MD History: Update timestamp hover text when item changes (Closed)
Patch Set: Be lazy again Created 3 years, 5 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 /** 5 /**
6 * @param {!Element} root 6 * @param {!Element} root
7 * @param {?Element} boundary 7 * @param {?Element} boundary
8 * @param {cr.ui.FocusRow.Delegate} delegate 8 * @param {cr.ui.FocusRow.Delegate} delegate
9 * @constructor 9 * @constructor
10 * @extends {cr.ui.FocusRow} 10 * @extends {cr.ui.FocusRow}
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 }; 79 };
80 80
81 var HistoryItem = Polymer({ 81 var HistoryItem = Polymer({
82 is: 'history-item', 82 is: 'history-item',
83 83
84 properties: { 84 properties: {
85 // Underlying HistoryEntry data for this item. Contains read-only fields 85 // Underlying HistoryEntry data for this item. Contains read-only fields
86 // from the history backend, as well as fields computed by history-list. 86 // from the history backend, as well as fields computed by history-list.
87 item: { 87 item: {
88 type: Object, 88 type: Object,
89 observer: 'showIcon_', 89 observer: 'itemChanged_',
90 }, 90 },
91 91
92 selected: { 92 selected: {
93 type: Boolean, 93 type: Boolean,
94 reflectToAttribute: true, 94 reflectToAttribute: true,
95 }, 95 },
96 96
97 isCardStart: { 97 isCardStart: {
98 type: Boolean, 98 type: Boolean,
99 reflectToAttribute: true, 99 reflectToAttribute: true,
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 onLinkRightClick_: function() { 297 onLinkRightClick_: function() {
298 md_history.BrowserService.getInstance().recordAction( 298 md_history.BrowserService.getInstance().recordAction(
299 'EntryLinkRightClick'); 299 'EntryLinkRightClick');
300 }, 300 },
301 301
302 /** 302 /**
303 * Set the favicon image, based on the URL of the history item. 303 * Set the favicon image, based on the URL of the history item.
304 * @private 304 * @private
305 */ 305 */
306 showIcon_: function() { 306 itemChanged_: function() {
307 this.$.icon.style.backgroundImage = cr.icon.getFavicon(this.item.url); 307 this.$.icon.style.backgroundImage = cr.icon.getFavicon(this.item.url);
308 this.listen(this.$['time-accessed'], 'mouseover', 'addTimeTitle_');
308 }, 309 },
309 310
310 /** 311 /**
311 * @param {number} numberOfItems The number of items in the card. 312 * @param {number} numberOfItems The number of items in the card.
312 * @param {string} historyDate Date of the current result. 313 * @param {string} historyDate Date of the current result.
313 * @param {string} search The search term associated with these results. 314 * @param {string} search The search term associated with these results.
314 * @return {string} The title for this history card. 315 * @return {string} The title for this history card.
315 * @private 316 * @private
316 */ 317 */
317 cardTitle_: function(numberOfItems, historyDate, search) { 318 cardTitle_: function(numberOfItems, historyDate, search) {
(...skipping 17 matching lines...) Expand all
335 */ 336 */
336 HistoryItem.searchResultsTitle = function(numberOfResults, searchTerm) { 337 HistoryItem.searchResultsTitle = function(numberOfResults, searchTerm) {
337 var resultId = numberOfResults == 1 ? 'searchResult' : 'searchResults'; 338 var resultId = numberOfResults == 1 ? 'searchResult' : 'searchResults';
338 return loadTimeData.getStringF( 339 return loadTimeData.getStringF(
339 'foundSearchResults', numberOfResults, loadTimeData.getString(resultId), 340 'foundSearchResults', numberOfResults, loadTimeData.getString(resultId),
340 searchTerm); 341 searchTerm);
341 }; 342 };
342 343
343 return {HistoryItem: HistoryItem}; 344 return {HistoryItem: HistoryItem};
344 }); 345 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/history_item.html ('k') | chrome/test/data/webui/md_history/history_item_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698