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

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: move getShouldShowApps message to onLoad. 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
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/browser/ui/webui/ntp/new_tab_page_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5442bbd1b734aaef4f2d4b6f0b94abba6dc0ce39 100644
--- a/chrome/browser/resources/ntp4/new_tab.js
+++ b/chrome/browser/resources/ntp4/new_tab.js
@@ -110,10 +110,20 @@ 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.
*/
function onLoad() {
+ // This will end up calling ntp.gotShouldShowApps.
+ chrome.send('getShouldShowApps');
sectionsToWaitFor = loadTimeData.getBoolean('showApps') ? 2 : 1;
if (loadTimeData.getBoolean('isDiscoveryInNTPEnabled'))
sectionsToWaitFor++;
@@ -628,6 +638,7 @@ cr.define('ntp', function() {
getAppsPageIndex: getAppsPageIndex,
getCardSlider: getCardSlider,
onLoad: onLoad,
+ gotShouldShowApps: gotShouldShowApps,
leaveRearrangeMode: leaveRearrangeMode,
logTimeToClick: logTimeToClick,
NtpFollowAction: NtpFollowAction,
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/browser/ui/webui/ntp/new_tab_page_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698