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

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

Issue 9567027: aura: Remove apps from NTP4 and disable NTP4 intro bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 10 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/page_list_view.js
diff --git a/chrome/browser/resources/ntp4/page_list_view.js b/chrome/browser/resources/ntp4/page_list_view.js
index 0ae63202bbcf4fdbc6de10bc3280ce1f8caf949a..5c2bd3e56119f590919823b1b31bcc3e520e2604 100644
--- a/chrome/browser/resources/ntp4/page_list_view.js
+++ b/chrome/browser/resources/ntp4/page_list_view.js
@@ -153,10 +153,21 @@ cr.define('ntp', function() {
this.shownPage = templateData.shown_page_type;
this.shownPageIndex = templateData.shown_page_index;
- // Request data on the apps so we can fill them in.
- // Note that this is kicked off asynchronously. 'getAppsCallback' will be
- // invoked at some point after this function returns.
- chrome.send('getApps');
+ if (templateData.showAppsPage) {
+ // Request data on the apps so we can fill them in.
+ // Note that this is kicked off asynchronously. 'getAppsCallback' will
+ // be invoked at some point after this function returns.
+ chrome.send('getApps');
+ } else {
+ // No apps page.
+ if (this.shownPage == templateData['apps_page_id']) {
+ this.shownPage = templateData['most_visited_page_id'];
+ this.shownPageIndex = 0;
+ }
+
+ // Mark section ready asynchronously soon after.
+ window.setTimeout(this.markSectionReady_.bind(this), 0);
+ }
document.addEventListener('keydown', this.onDocKeyDown_.bind(this));
// Prevent touch events from triggering any sort of native scrolling
@@ -366,18 +377,25 @@ cr.define('ntp', function() {
this.cardSlider.currentCard = prevCurrentCard;
- // Tell the slider about the pages.
- this.updateSliderCards();
-
if (highlightApp)
this.appAdded(highlightApp, true);
+ logEvent('apps.layout: ' + (Date.now() - startTime));
+
+ this.markSectionReady_();
+ },
+
+ /**
+ * Marks section ready.
+ * @private
+ */
+ markSectionReady_: function() {
+ // Tell the slider about the pages.
+ this.updateSliderCards();
// Mark the current page.
this.cardSlider.currentCardValue.navigationDot.classList.add('selected');
- logEvent('apps.layout: ' + (Date.now() - startTime));
document.documentElement.classList.remove('starting-up');
-
cr.dispatchSimpleEvent(document, 'sectionready', true, true);
},
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/new_tab_page_handler.cc » ('j') | chrome/browser/ui/webui/ntp/new_tab_ui.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698