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

Side by Side Diff: chrome/browser/resources/ntp4/new_tab.js

Issue 7640009: [ntp4] Fix last page persist state for bookmarks page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview New tab page 6 * @fileoverview New tab page
7 * This is the main code for the new tab page used by touch-enabled Chrome 7 * This is the main code for the new tab page used by touch-enabled Chrome
8 * browsers. For now this is still a prototype. 8 * browsers. For now this is still a prototype.
9 */ 9 */
10 10
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 pageNo = tilePages.length - 1; 381 pageNo = tilePages.length - 1;
382 var pageArray = []; 382 var pageArray = [];
383 for (var i = 0; i < tilePages.length; i++) 383 for (var i = 0; i < tilePages.length; i++)
384 pageArray[i] = tilePages[i]; 384 pageArray[i] = tilePages[i];
385 cardSlider.setCards(pageArray, pageNo); 385 cardSlider.setCards(pageArray, pageNo);
386 386
387 if (shownPage == templateData['most_visited_page_id']) 387 if (shownPage == templateData['most_visited_page_id'])
388 cardSlider.selectCardByValue(mostVisitedPage); 388 cardSlider.selectCardByValue(mostVisitedPage);
389 else if (shownPage == templateData['apps_page_id']) 389 else if (shownPage == templateData['apps_page_id'])
390 cardSlider.selectCardByValue(appsPages[shownPageIndex]); 390 cardSlider.selectCardByValue(appsPages[shownPageIndex]);
391 else if (shownPage == templateData['bookmarks_page_id'])
392 cardSlider.selectCardByValue(bookmarksPage);
391 } 393 }
392 394
393 /** 395 /**
394 * Appends a tile page (for bookmarks or most visited). 396 * Appends a tile page (for bookmarks or most visited).
395 * 397 *
396 * @param {TilePage} page The page element. 398 * @param {TilePage} page The page element.
397 * @param {string} title The title of the tile page. 399 * @param {string} title The title of the tile page.
398 */ 400 */
399 function appendTilePage(page, title) { 401 function appendTilePage(page, title) {
400 pageList.appendChild(page); 402 pageList.appendChild(page);
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 // TODO(estade): update the content handlers to use ntp namespace instead of 717 // TODO(estade): update the content handlers to use ntp namespace instead of
716 // making these global. 718 // making these global.
717 var assert = ntp4.assert; 719 var assert = ntp4.assert;
718 var getAppsCallback = ntp4.getAppsCallback; 720 var getAppsCallback = ntp4.getAppsCallback;
719 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; 721 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback;
720 var themeChanged = ntp4.themeChanged; 722 var themeChanged = ntp4.themeChanged;
721 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; 723 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs;
722 var setMostVisitedPages = ntp4.setMostVisitedPages; 724 var setMostVisitedPages = ntp4.setMostVisitedPages;
723 725
724 document.addEventListener('DOMContentLoaded', ntp4.initialize); 726 document.addEventListener('DOMContentLoaded', ntp4.initialize);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698