| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "chrome/browser/history/top_sites.h" | 5 #include "components/history/core/browser/top_sites.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | |
| 8 #include "chrome/grit/chromium_strings.h" | |
| 9 #include "chrome/grit/generated_resources.h" | |
| 10 #include "chrome/grit/locale_settings.h" | |
| 11 #include "components/history/core/browser/top_sites_observer.h" | 7 #include "components/history/core/browser/top_sites_observer.h" |
| 12 #include "grit/theme_resources.h" | |
| 13 | 8 |
| 14 namespace history { | 9 namespace history { |
| 15 | 10 |
| 16 const TopSites::PrepopulatedPage kPrepopulatedPages[] = { | 11 PrepopulatedPage::PrepopulatedPage() |
| 17 #if !defined(OS_ANDROID) | 12 : most_visited(), favicon_id(-1), thumbnail_id(-1), color() { |
| 18 {IDS_CHROME_WELCOME_URL, | 13 } |
| 19 IDS_NEW_TAB_CHROME_WELCOME_PAGE_TITLE, | 14 |
| 20 IDR_PRODUCT_LOGO_16, | 15 PrepopulatedPage::PrepopulatedPage(const GURL& url, |
| 21 IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL, | 16 const base::string16& title, |
| 22 SkColorSetRGB(0, 147, 60)}, | 17 int favicon_id, |
| 23 {IDS_WEBSTORE_URL, | 18 int thumbnail_id, |
| 24 IDS_EXTENSION_WEB_STORE_TITLE, | 19 SkColor color) |
| 25 IDR_WEBSTORE_ICON_16, | 20 : most_visited(url, title), |
| 26 IDR_NEWTAB_WEBSTORE_THUMBNAIL, | 21 favicon_id(favicon_id), |
| 27 SkColorSetRGB(63, 132, 197)} | 22 thumbnail_id(thumbnail_id), |
| 28 #endif | 23 color(color) { |
| 29 }; | 24 most_visited.redirects.push_back(url); |
| 25 } |
| 30 | 26 |
| 31 TopSites::TopSites() { | 27 TopSites::TopSites() { |
| 32 } | 28 } |
| 33 | 29 |
| 34 TopSites::~TopSites() { | 30 TopSites::~TopSites() { |
| 35 } | 31 } |
| 36 | 32 |
| 37 void TopSites::AddObserver(TopSitesObserver* observer) { | 33 void TopSites::AddObserver(TopSitesObserver* observer) { |
| 38 observer_list_.AddObserver(observer); | 34 observer_list_.AddObserver(observer); |
| 39 } | 35 } |
| 40 | 36 |
| 41 void TopSites::RemoveObserver(TopSitesObserver* observer) { | 37 void TopSites::RemoveObserver(TopSitesObserver* observer) { |
| 42 observer_list_.RemoveObserver(observer); | 38 observer_list_.RemoveObserver(observer); |
| 43 } | 39 } |
| 44 | 40 |
| 45 void TopSites::NotifyTopSitesLoaded() { | 41 void TopSites::NotifyTopSitesLoaded() { |
| 46 FOR_EACH_OBSERVER(TopSitesObserver, observer_list_, TopSitesLoaded(this)); | 42 FOR_EACH_OBSERVER(TopSitesObserver, observer_list_, TopSitesLoaded(this)); |
| 47 } | 43 } |
| 48 | 44 |
| 49 void TopSites::NotifyTopSitesChanged() { | 45 void TopSites::NotifyTopSitesChanged() { |
| 50 FOR_EACH_OBSERVER(TopSitesObserver, observer_list_, TopSitesChanged(this)); | 46 FOR_EACH_OBSERVER(TopSitesObserver, observer_list_, TopSitesChanged(this)); |
| 51 } | 47 } |
| 52 | 48 |
| 53 } // namespace history | 49 } // namespace history |
| OLD | NEW |