Chromium Code Reviews| 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 "chrome/browser/history/top_sites.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "chrome/browser/history/top_sites_impl.h" | 8 #include "chrome/browser/history/top_sites_impl.h" |
|
sdefresne
2015/01/22 19:05:05
Remove this unused #include.
Jitu( very slow this week)
2015/01/23 11:36:52
Done.
| |
| 9 #include "chrome/grit/chromium_strings.h" | 9 #include "chrome/grit/chromium_strings.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| 11 #include "chrome/grit/locale_settings.h" | 11 #include "chrome/grit/locale_settings.h" |
| 12 #include "grit/theme_resources.h" | 12 #include "grit/theme_resources.h" |
| 13 | 13 |
| 14 namespace history { | 14 namespace history { |
| 15 | 15 |
| 16 const TopSites::PrepopulatedPage kPrepopulatedPages[] = { | 16 const TopSites::PrepopulatedPage kPrepopulatedPages[] = { |
| 17 #if !defined(OS_ANDROID) | 17 #if !defined(OS_ANDROID) |
| 18 { IDS_CHROME_WELCOME_URL, IDS_NEW_TAB_CHROME_WELCOME_PAGE_TITLE, | 18 {IDS_CHROME_WELCOME_URL, |
| 19 IDR_PRODUCT_LOGO_16, IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL, | 19 IDS_NEW_TAB_CHROME_WELCOME_PAGE_TITLE, |
| 20 SkColorSetRGB(0, 147, 60) }, | 20 IDR_PRODUCT_LOGO_16, |
| 21 { IDS_WEBSTORE_URL, IDS_EXTENSION_WEB_STORE_TITLE, | 21 IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL, |
| 22 IDR_WEBSTORE_ICON_16, IDR_NEWTAB_WEBSTORE_THUMBNAIL, | 22 SkColorSetRGB(0, 147, 60)}, |
| 23 SkColorSetRGB(63, 132, 197) } | 23 {IDS_WEBSTORE_URL, |
| 24 IDS_EXTENSION_WEB_STORE_TITLE, | |
| 25 IDR_WEBSTORE_ICON_16, | |
| 26 IDR_NEWTAB_WEBSTORE_THUMBNAIL, | |
| 27 SkColorSetRGB(63, 132, 197)} | |
| 24 #endif | 28 #endif |
| 25 }; | 29 }; |
| 26 | 30 |
| 27 // static | |
| 28 TopSites* TopSites::Create(Profile* profile, const base::FilePath& db_name) { | |
| 29 TopSitesImpl* top_sites_impl = new TopSitesImpl(profile); | |
| 30 top_sites_impl->Init(db_name); | |
| 31 return top_sites_impl; | |
| 32 } | |
| 33 | |
| 34 TopSites::TopSites() { | 31 TopSites::TopSites() { |
| 35 } | 32 } |
| 36 | 33 |
| 37 TopSites::~TopSites() { | 34 TopSites::~TopSites() { |
| 38 } | 35 } |
| 39 | 36 |
| 40 void TopSites::AddObserver(TopSitesObserver* observer) { | 37 void TopSites::AddObserver(TopSitesObserver* observer) { |
| 41 observer_list_.AddObserver(observer); | 38 observer_list_.AddObserver(observer); |
| 42 } | 39 } |
| 43 | 40 |
| 44 void TopSites::RemoveObserver(TopSitesObserver* observer) { | 41 void TopSites::RemoveObserver(TopSitesObserver* observer) { |
| 45 observer_list_.RemoveObserver(observer); | 42 observer_list_.RemoveObserver(observer); |
| 46 } | 43 } |
| 47 | 44 |
| 48 void TopSites::NotifyTopSitesLoaded() { | 45 void TopSites::NotifyTopSitesLoaded() { |
| 49 FOR_EACH_OBSERVER(TopSitesObserver, observer_list_, TopSitesLoaded(this)); | 46 FOR_EACH_OBSERVER(TopSitesObserver, observer_list_, TopSitesLoaded(this)); |
| 50 } | 47 } |
| 51 | 48 |
| 52 void TopSites::NotifyTopSitesChanged() { | 49 void TopSites::NotifyTopSitesChanged() { |
| 53 FOR_EACH_OBSERVER(TopSitesObserver, observer_list_, TopSitesChanged(this)); | 50 FOR_EACH_OBSERVER(TopSitesObserver, observer_list_, TopSitesChanged(this)); |
| 54 } | 51 } |
| 55 | 52 |
| 56 } // namespace history | 53 } // namespace history |
| OLD | NEW |