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

Unified Diff: chrome/browser/resources/ntp/apps.js

Issue 3001003: NTP: Use the store as the last thumbnail in case we have no apps installed.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/ntp/apps.css ('k') | chrome/browser/resources/ntp/web_store_icon.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp/apps.js
===================================================================
--- chrome/browser/resources/ntp/apps.js (revision 52778)
+++ chrome/browser/resources/ntp/apps.js (working copy)
@@ -12,7 +12,6 @@
appsSection.appendChild(apps.createElement(app));
});
-
// TODO(aa): Figure out what to do with the debug mode when we turn apps on
// for everyone.
if (appsSection.hasChildNodes()) {
@@ -20,6 +19,8 @@
if (data.showDebugLink) {
debugSection.classList.remove('disabled');
}
+
+ appsSection.appendChild(apps.createWebStoreElement());
} else {
appsSection.classList.add('disabled');
debugSection.classList.add('disabled');
@@ -58,7 +59,7 @@
return false;
},
- createElement: function(app) {
+ createElement_: function(app) {
var div = document.createElement('div');
div.className = 'app';
@@ -70,6 +71,14 @@
a.xtitle = a.textContent = app['name'];
a.href = app['launch_url'];
+ return div;
+ },
+
+ createElement: function(app) {
+ var div = this.createElement_(app);
+ var front = div.firstChild;
+ var a = front.firstChild;
+
a.onclick = apps.handleClick_;
a.style.backgroundImage = url(app['icon']);
if (hashParams['app-id'] == app['id']) {
@@ -112,5 +121,13 @@
};
return div;
+ },
+
+ createWebStoreElement: function() {
+ return this.createElement_({
+ 'id': 'web-store-entry',
+ 'name': localStrings.getString('web_store_title'),
+ 'launch_url': localStrings.getString('web_store_url')
+ });
}
};
« no previous file with comments | « chrome/browser/resources/ntp/apps.css ('k') | chrome/browser/resources/ntp/web_store_icon.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698