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

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

Issue 10141005: switch ntp to jstemplate v2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update test 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
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 '<span class="thumbnail fills-parent">' + 66 '<span class="thumbnail fills-parent">' +
67 // thumbnail-shield provides a gradient fade effect. 67 // thumbnail-shield provides a gradient fade effect.
68 '<div class="thumbnail-shield fills-parent"></div>' + 68 '<div class="thumbnail-shield fills-parent"></div>' +
69 '</span>' + 69 '</span>' +
70 '<span class="favicon"></span>' + 70 '<span class="favicon"></span>' +
71 '</span>' + 71 '</span>' +
72 '<div class="color-stripe"></div>' + 72 '<div class="color-stripe"></div>' +
73 '<span class="title"></span>'; 73 '<span class="title"></span>';
74 74
75 this.querySelector('.close-button').title = 75 this.querySelector('.close-button').title =
76 templateData.removethumbnailtooltip; 76 loadTimeData.getString('removethumbnailtooltip');
77 77
78 this.tabIndex = -1; 78 this.tabIndex = -1;
79 this.data_ = null; 79 this.data_ = null;
80 this.removeAttribute('id'); 80 this.removeAttribute('id');
81 this.title = ''; 81 this.title = '';
82 }, 82 },
83 83
84 /** 84 /**
85 * Update the appearance of this tile according to |data|. 85 * Update the appearance of this tile according to |data|.
86 * @param {Object} data A dictionary of relevant data for the page. 86 * @param {Object} data A dictionary of relevant data for the page.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 showUndoNotification_: function() { 177 showUndoNotification_: function() {
178 var data = this.data_; 178 var data = this.data_;
179 var self = this; 179 var self = this;
180 var doUndo = function() { 180 var doUndo = function() {
181 chrome.send('removeURLsFromSuggestionsBlacklist', [data.url]); 181 chrome.send('removeURLsFromSuggestionsBlacklist', [data.url]);
182 self.updateForData(data); 182 self.updateForData(data);
183 }; 183 };
184 184
185 var undo = { 185 var undo = {
186 action: doUndo, 186 action: doUndo,
187 text: templateData.undothumbnailremove, 187 text: loadTimeData.getString('undothumbnailremove'),
188 }; 188 };
189 189
190 var undoAll = { 190 var undoAll = {
191 action: function() { 191 action: function() {
192 chrome.send('clearSuggestionsURLsBlacklist'); 192 chrome.send('clearSuggestionsURLsBlacklist');
193 }, 193 },
194 text: templateData.restoreThumbnailsShort, 194 text: loadTimeData.getString('restoreThumbnailsShort'),
195 }; 195 };
196 196
197 ntp.showNotification(templateData.thumbnailremovednotification, 197 ntp.showNotification(
198 [undo, undoAll]); 198 loadTimeData.getString('thumbnailremovednotification'),
199 [undo, undoAll]);
199 }, 200 },
200 201
201 /** 202 /**
202 * Set the size and position of the suggestions tile. 203 * Set the size and position of the suggestions tile.
203 * @param {number} size The total size of |this|. 204 * @param {number} size The total size of |this|.
204 * @param {number} x The x-position. 205 * @param {number} x The x-position.
205 * @param {number} y The y-position. 206 * @param {number} y The y-position.
206 */ 207 */
207 setBounds: function(size, x, y) { 208 setBounds: function(size, x, y) {
208 this.style.width = size + 'px'; 209 this.style.width = size + 'px';
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 449 }
449 450
450 return oldData; 451 return oldData;
451 } 452 }
452 453
453 return { 454 return {
454 SuggestionsPage: SuggestionsPage, 455 SuggestionsPage: SuggestionsPage,
455 refreshData: refreshData, 456 refreshData: refreshData,
456 }; 457 };
457 }); 458 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698