Chromium Code Reviews| 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 1d56e50e0b4068beb4695eef49adabc31b1d0f2a..fd3e9cfb2a4cba1ef7e96ee556cf7b8243f2a196 100644 |
| --- a/chrome/browser/resources/ntp4/page_list_view.js |
| +++ b/chrome/browser/resources/ntp4/page_list_view.js |
| @@ -59,6 +59,12 @@ cr.define('ntp4', function() { |
| appsPages: undefined, |
| /** |
| + * The Suggested page. |
| + * @type {!Element|undefined} |
| + */ |
| + suggestedPage: undefined, |
| + |
| + /** |
| * The Most Visited page. |
| * @type {!Element|undefined} |
| */ |
| @@ -212,6 +218,11 @@ cr.define('ntp4', function() { |
| this.mostVisitedPage = page; |
| } |
| + if (typeof ntp4.SuggestedPage != 'undefined' && |
| + page instanceof ntp4.SuggestedPage) { |
| + this.suggestedPage = page; |
| + } |
| + |
| // If we're appending an AppsPage and it's a temporary page, animate it. |
| var animate = page instanceof ntp4.AppsPage && |
| page.classList.contains('temporary'); |
| @@ -416,6 +427,10 @@ cr.define('ntp4', function() { |
| if (this.mostVisitedPage) |
| this.cardSlider.selectCardByValue(this.mostVisitedPage); |
| break; |
| + case templateData['suggested_page_id']: |
| + if (this.suggestedPage) |
| + this.cardSlider.selectCardByValue(this.suggestedPage); |
| + break; |
| } |
| }, |
| @@ -530,6 +545,9 @@ cr.define('ntp4', function() { |
| } else if (page.classList.contains('most-visited-page')) { |
| this.shownPage = templateData.most_visited_page_id; |
| this.shownPageIndex = 0; |
| + } else if (page.classList.contains('suggested-page')) { |
| + this.shownPage = templateData.suggested_page_id; |
| + this.shownPageIndex = this.getAppsPageIndex(page); |
|
Evan Stade
2012/02/09 01:54:23
you copy pasta'd the wrong line here. Copy L547
GeorgeY
2012/02/10 00:00:36
Shoot. missed it - done :)
|
| } else { |
| console.error('unknown page selected'); |
| } |