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

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

Issue 1129903008: NTP Zombie Code Slayer Part IV: Most Visited (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: and remove WEB_UI_UNITTEST_F 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
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 4c1ac76f31e05b1452ab5257f70d49db5c2954f6..4f03f5927a326e2851b3fd528d30dd82c249a64e 100644
--- a/chrome/browser/resources/ntp4/new_tab.js
+++ b/chrome/browser/resources/ntp4/new_tab.js
@@ -8,15 +8,6 @@
* browsers. For now this is still a prototype.
*/
-/**
- * @typedef {{direction: string,
- * filler: (boolean|undefined),
- * title: string,
- * url: string}}
- * @see chrome/browser/ui/webui/ntp/most_visited_handler.cc
- */
-var PageData;
-
// Use an anonymous function to enable strict mode just for this file (which
// will be concatenated with other files when embedded in Chrome
cr.define('ntp', function() {
@@ -126,8 +117,6 @@ cr.define('ntp', function() {
*/
function onLoad() {
sectionsToWaitFor = 0;
- if (loadTimeData.getBoolean('showMostvisited'))
- sectionsToWaitFor++;
if (loadTimeData.getBoolean('showApps')) {
sectionsToWaitFor++;
if (loadTimeData.getBoolean('showAppLauncherPromo')) {
@@ -157,18 +146,6 @@ cr.define('ntp', function() {
getRequiredElement('other-sessions-menu-button').hidden = true;
}
- if (loadTimeData.getBoolean('showMostvisited')) {
- var mostVisited = new ntp.MostVisitedPage();
- // Move the footer into the most visited page if we are in "bare minimum"
- // mode.
- if (document.body.classList.contains('bare-minimum'))
- mostVisited.appendFooter(getRequiredElement('footer'));
- newTabView.appendTilePage(mostVisited,
- loadTimeData.getString('mostvisited'),
- false);
- chrome.send('getMostVisited');
- }
-
if (!loadTimeData.getBoolean('showWebStoreIcon')) {
var webStoreIcon = $('chrome-web-store-link');
// Not all versions of the NTP have a footer, so this may not exist.
@@ -341,14 +318,11 @@ cr.define('ntp', function() {
* its length may be measured and the nav dots sized accordingly.
*/
function measureNavDots() {
- var pxWidth = measureNavDot('appDefaultPageName');
- if (loadTimeData.getBoolean('showMostvisited'))
- pxWidth = Math.max(measureNavDot('mostvisited'), pxWidth);
-
var styleElement = document.createElement('style');
styleElement.type = 'text/css';
// max-width is used because if we run out of space, the nav dots will be
// shrunk.
+ var pxWidth = measureNavDot('appDefaultPageName');
styleElement.textContent = '.dot { max-width: ' + pxWidth + 'px; }';
document.querySelector('head').appendChild(styleElement);
}
@@ -522,15 +496,6 @@ cr.define('ntp', function() {
}
/**
- * @param {Array<PageData>} data
- * @param {boolean} hasBlacklistedUrls
- */
- function setMostVisitedPages(data, hasBlacklistedUrls) {
- newTabView.mostVisitedPage.data = data;
- cr.dispatchSimpleEvent(document, 'sectionready', true, true);
- }
-
- /**
* Set the dominant color for a node. This will be called in response to
* getFaviconDominantColor. The node represented by |id| better have a setter
* for stripeColor.
@@ -592,16 +557,6 @@ cr.define('ntp', function() {
}
/**
- * Logs the time to click for the specified item.
- * @param {string} item The item to log the time-to-click.
- */
- function logTimeToClick(item) {
- var timeToClick = Date.now() - startTime;
- chrome.send('logTimeToClick',
- ['NewTabPage.TimeToClick' + item, timeToClick]);
- }
-
- /**
* Wrappers to forward the callback to corresponding PageListView member.
*/
@@ -731,13 +686,11 @@ cr.define('ntp', function() {
getCardSlider: getCardSlider,
onLoad: onLoad,
leaveRearrangeMode: leaveRearrangeMode,
- logTimeToClick: logTimeToClick,
NtpFollowAction: NtpFollowAction,
saveAppPageName: saveAppPageName,
setAppToBeHighlighted: setAppToBeHighlighted,
setBookmarkBarAttached: setBookmarkBarAttached,
setForeignSessions: setForeignSessions,
- setMostVisitedPages: setMostVisitedPages,
setFaviconDominantColor: setFaviconDominantColor,
showNotification: showNotification,
themeChanged: themeChanged,

Powered by Google App Engine
This is Rietveld 408576698