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

Unified Diff: chrome/browser/resources/ntp_search/most_visited_page.js

Issue 11438009: NTP5: Refactoring appData to use Tile's data implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: NTP5: Refactoring appData to use Tile's data implementation Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/ntp_search/mock/mock.js ('k') | chrome/browser/resources/ntp_search/new_tab.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp_search/most_visited_page.js
diff --git a/chrome/browser/resources/ntp_search/most_visited_page.js b/chrome/browser/resources/ntp_search/most_visited_page.js
index d5a0b5235ffa196510961db028a44686bea1704e..1b135114ba34cb85cf70de046d31d60c3475a9f6 100644
--- a/chrome/browser/resources/ntp_search/most_visited_page.js
+++ b/chrome/browser/resources/ntp_search/most_visited_page.js
@@ -13,12 +13,11 @@ cr.define('ntp', function() {
* @constructor
* @extends {Thumbnail}
* @extends {HTMLAnchorElement}
- * @param {Object} config Tile page configuration object.
*/
- function MostVisited(config) {
+ function MostVisited() {
var el = cr.doc.createElement('a');
el.__proto__ = MostVisited.prototype;
- el.initialize(config);
+ el.initialize();
return el;
}
@@ -28,9 +27,8 @@ cr.define('ntp', function() {
/**
* Initializes a MostVisited Thumbnail.
- * @param {Object} config TilePage configuration object.
*/
- initialize: function(config) {
+ initialize: function() {
Thumbnail.prototype.initialize.apply(this, arguments);
this.addEventListener('click', this.handleClick_);
@@ -56,14 +54,18 @@ cr.define('ntp', function() {
* Update the appearance of this tile according to |data|.
* @param {Object} data A dictionary of relevant data for the page.
*/
- setData: function(data) {
+ set data(data) {
+ Object.getOwnPropertyDescriptor(Thumbnail.prototype, 'data').set.apply(
+ this, arguments);
+
if (this.classList.contains('blacklisted') && data) {
// Animate appearance of new tile.
this.classList.add('new-tile-contents');
}
this.classList.remove('blacklisted');
-
- Thumbnail.prototype.setData.apply(this, arguments);
+ },
+ get data() {
+ return this.data_;
},
/**
« no previous file with comments | « chrome/browser/resources/ntp_search/mock/mock.js ('k') | chrome/browser/resources/ntp_search/new_tab.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698