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

Side by Side Diff: chrome/browser/resources/ntp4/most_visited_page.js

Issue 10141005: switch ntp to jstemplate v2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test once and for all Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | chrome/browser/resources/ntp4/new_tab.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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('ntp', function() { 5 cr.define('ntp', function() {
6 'use strict'; 6 'use strict';
7 7
8 var TilePage = ntp.TilePage; 8 var TilePage = ntp.TilePage;
9 9
10 /** 10 /**
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 '<span class="thumbnail fills-parent">' + 56 '<span class="thumbnail fills-parent">' +
57 // thumbnail-shield provides a gradient fade effect. 57 // thumbnail-shield provides a gradient fade effect.
58 '<div class="thumbnail-shield fills-parent"></div>' + 58 '<div class="thumbnail-shield fills-parent"></div>' +
59 '</span>' + 59 '</span>' +
60 '<span class="favicon"></span>' + 60 '<span class="favicon"></span>' +
61 '</span>' + 61 '</span>' +
62 '<div class="color-stripe"></div>' + 62 '<div class="color-stripe"></div>' +
63 '<span class="title"></span>'; 63 '<span class="title"></span>';
64 64
65 this.querySelector('.close-button').title = 65 this.querySelector('.close-button').title =
66 templateData.removethumbnailtooltip; 66 loadTimeData.getString('removethumbnailtooltip');
67 67
68 this.tabIndex = -1; 68 this.tabIndex = -1;
69 this.data_ = null; 69 this.data_ = null;
70 this.removeAttribute('id'); 70 this.removeAttribute('id');
71 this.title = ''; 71 this.title = '';
72 }, 72 },
73 73
74 /** 74 /**
75 * Update the appearance of this tile according to |data|. 75 * Update the appearance of this tile according to |data|.
76 * @param {Object} data A dictionary of relevant data for the page. 76 * @param {Object} data A dictionary of relevant data for the page.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 showUndoNotification_: function() { 168 showUndoNotification_: function() {
169 var data = this.data_; 169 var data = this.data_;
170 var self = this; 170 var self = this;
171 var doUndo = function() { 171 var doUndo = function() {
172 chrome.send('removeURLsFromMostVisitedBlacklist', [data.url]); 172 chrome.send('removeURLsFromMostVisitedBlacklist', [data.url]);
173 self.updateForData(data); 173 self.updateForData(data);
174 } 174 }
175 175
176 var undo = { 176 var undo = {
177 action: doUndo, 177 action: doUndo,
178 text: templateData.undothumbnailremove, 178 text: loadTimeData.getString('undothumbnailremove'),
179 }; 179 };
180 180
181 var undoAll = { 181 var undoAll = {
182 action: function() { 182 action: function() {
183 chrome.send('clearMostVisitedURLsBlacklist'); 183 chrome.send('clearMostVisitedURLsBlacklist');
184 }, 184 },
185 text: templateData.restoreThumbnailsShort, 185 text: loadTimeData.getString('restoreThumbnailsShort'),
186 }; 186 };
187 187
188 ntp.showNotification(templateData.thumbnailremovednotification, 188 ntp.showNotification(
189 [undo, undoAll]); 189 loadTimeData.getString('thumbnailremovednotification'),
190 [undo, undoAll]);
190 }, 191 },
191 192
192 /** 193 /**
193 * Set the size and position of the most visited tile. 194 * Set the size and position of the most visited tile.
194 * @param {number} size The total size of |this|. 195 * @param {number} size The total size of |this|.
195 * @param {number} x The x-position. 196 * @param {number} x The x-position.
196 * @param {number} y The y-position. 197 * @param {number} y The y-position.
197 * animate. 198 * animate.
198 */ 199 */
199 setBounds: function(size, x, y) { 200 setBounds: function(size, x, y) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 418 }
418 419
419 return oldData; 420 return oldData;
420 }; 421 };
421 422
422 return { 423 return {
423 MostVisitedPage: MostVisitedPage, 424 MostVisitedPage: MostVisitedPage,
424 refreshData: refreshData, 425 refreshData: refreshData,
425 }; 426 };
426 }); 427 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | chrome/browser/resources/ntp4/new_tab.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698