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

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: Addressing Dan's comments 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
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..329a6227ac1316908e549802344b791c2e076521 100644
--- a/chrome/browser/resources/ntp_search/most_visited_page.js
+++ b/chrome/browser/resources/ntp_search/most_visited_page.js
@@ -56,14 +56,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_;
Dan Beam 2012/12/07 05:05:31 nit: what does this offer over Thumbnail.data / do
pedro (no code reviews) 2012/12/07 21:54:55 Yes, I do need this. I might be missing something
Dan Beam 2012/12/07 22:31:07 in JS, "private" members exist on all sub classes
pedro (no code reviews) 2012/12/10 19:44:43 I guess I wasn't clear enough in my previous comme
},
/**

Powered by Google App Engine
This is Rietveld 408576698