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

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

Issue 1129903008: NTP Zombie Code Slayer Part IV: Most Visited (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android fix Created 5 years, 7 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/ntp4/new_tab_theme.css ('k') | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fa1513b9bd39098318c04f08da54c9014ae5f2a3..a13a4245d3aec55cfc75e56be93f85de088d49e6 100644
--- a/chrome/browser/resources/ntp4/page_list_view.js
+++ b/chrome/browser/resources/ntp4/page_list_view.js
@@ -86,12 +86,6 @@ cr.define('ntp', function() {
appsPages: undefined,
/**
- * The Most Visited page.
- * @type {!Element|undefined}
- */
- mostVisitedPage: undefined,
-
- /**
* The 'dots-list' element.
* @type {!Element|undefined}
*/
@@ -174,20 +168,13 @@ cr.define('ntp', function() {
this.shownPage = loadTimeData.getInteger('shown_page_type');
this.shownPageIndex = loadTimeData.getInteger('shown_page_index');
- if (loadTimeData.getBoolean('showApps')) {
- // 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 == loadTimeData.getInteger('apps_page_id')) {
- this.setShownPage_(
- loadTimeData.getInteger('most_visited_page_id'), 0);
- }
+ // TODO(dbeam): remove showApps and everything that says if (apps).
+ assert(loadTimeData.getBoolean('showApps'));
- document.body.classList.add('bare-minimum');
- }
+ // 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');
document.addEventListener('keydown', this.onDocKeyDown_.bind(this));
@@ -259,14 +246,6 @@ cr.define('ntp', function() {
this.cardSlider.appendCard(page);
}
- // Remember special MostVisitedPage.
- if (typeof ntp.MostVisitedPage != 'undefined' &&
- page instanceof ntp.MostVisitedPage) {
- assert(this.tilePages.length == 1,
- 'MostVisitedPage should be added as first tile page');
- this.mostVisitedPage = page;
- }
-
// If we're appending an AppsPage and it's a temporary page, animate it.
var animate = page instanceof ntp.AppsPage &&
page.classList.contains('temporary');
@@ -489,11 +468,10 @@ cr.define('ntp', function() {
$(data.apps[i].id).appData = data.apps[i];
}
- // Set the App dot names. Skip the first dot (Most Visited).
+ // Set the App dot names.
var dots = this.dotList.getElementsByClassName('dot');
- var start = this.mostVisitedPage ? 1 : 0;
- for (var i = start; i < dots.length; ++i) {
- dots[i].displayTitle = data.appPageNames[i - start] || '';
+ for (var i = 0; i < dots.length; ++i) {
+ dots[i].displayTitle = data.appPageNames[i] || '';
}
},
@@ -525,20 +503,11 @@ cr.define('ntp', function() {
this.tilePages.length - 1));
this.cardSlider.setCards(Array.prototype.slice.call(this.tilePages),
pageNo);
- if (this.shownPage == loadTimeData.getInteger('most_visited_page_id')) {
- if (this.mostVisitedPage)
- this.cardSlider.selectCardByValue(this.mostVisitedPage);
- else
- this.shownPage = loadTimeData.getInteger('apps_page_id');
- }
if (this.shownPage == loadTimeData.getInteger('apps_page_id') &&
loadTimeData.getBoolean('showApps')) {
this.cardSlider.selectCardByValue(
this.appsPages[Math.min(this.shownPageIndex,
this.appsPages.length - 1)]);
- } else if (this.mostVisitedPage) {
- this.shownPage = loadTimeData.getInteger('most_visited_page_id');
- this.cardSlider.selectCardByValue(this.mostVisitedPage);
}
},
@@ -665,9 +634,6 @@ cr.define('ntp', function() {
if (page.classList.contains('apps-page')) {
this.setShownPage_(loadTimeData.getInteger('apps_page_id'),
this.getAppsPageIndex(page));
- } else if (page.classList.contains('most-visited-page')) {
- this.setShownPage_(
- loadTimeData.getInteger('most_visited_page_id'), 0);
} else {
console.error('unknown page selected');
}
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab_theme.css ('k') | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698