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

Unified Diff: chrome/browser/resources/ntp4/new_tab.js

Issue 11953021: Don't show the apps page on the NTP if the app launcher is installed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make shouldShowApps a pref Created 7 years, 11 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
Index: chrome/browser/resources/ntp4/new_tab.js
diff --git a/chrome/browser/resources/ntp4/new_tab.js b/chrome/browser/resources/ntp4/new_tab.js
index 0fa946c3c41bec271769be9ca83af09b10e5b438..2a6c63bc4ed55e958f4d526b4b40df80bfe9f47f 100644
--- a/chrome/browser/resources/ntp4/new_tab.js
+++ b/chrome/browser/resources/ntp4/new_tab.js
@@ -110,6 +110,14 @@ cr.define('ntp', function() {
}
};
+ function gotShouldShowApps(shouldShowApps) {
+ if (shouldShowApps != loadTimeData.getBoolean('showApps')) {
+ // TODO(jeremya): update the UI in-place instead of reloading.
+ window.location.reload();
+ return;
+ }
+ }
+
/**
* Invoked at startup once the DOM is available to initialize the app.
*/
@@ -628,6 +636,7 @@ cr.define('ntp', function() {
getAppsPageIndex: getAppsPageIndex,
getCardSlider: getCardSlider,
onLoad: onLoad,
+ gotShouldShowApps: gotShouldShowApps,
leaveRearrangeMode: leaveRearrangeMode,
logTimeToClick: logTimeToClick,
NtpFollowAction: NtpFollowAction,
@@ -645,6 +654,8 @@ cr.define('ntp', function() {
};
});
+// This will end up calling ntp.gotShouldShowApps.
+chrome.send('getShouldShowApps');
Evan Stade 2013/01/23 23:34:24 this should probably be a part of onLoad
jeremya 2013/01/24 02:40:04 Why's that?
Evan Stade 2013/01/24 18:40:16 well, my thinking was that if gotShouldShowApps we
jeremya 2013/01/25 00:06:19 Right, that makes sense -- if we get the gotShould
document.addEventListener('DOMContentLoaded', ntp.onLoad);
var toCssPx = cr.ui.toCssPx;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/app_launcher_handler.h » ('j') | chrome/browser/ui/webui/ntp/app_launcher_handler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698