OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_factory.h" | 5 #include "chrome/browser/history/top_sites_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
11 #include "chrome/browser/history/history_utils.h" | 11 #include "chrome/browser/history/history_utils.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
14 #include "chrome/grit/chromium_strings.h" | 14 #include "chrome/grit/chromium_strings.h" |
15 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
16 #include "chrome/grit/locale_settings.h" | 16 #include "chrome/grit/locale_settings.h" |
17 #include "components/history/core/browser/history_constants.h" | 17 #include "components/history/core/browser/history_constants.h" |
18 #include "components/history/core/browser/top_sites_impl.h" | 18 #include "components/history/core/browser/top_sites_impl.h" |
19 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 19 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 20 #include "components/pref_registry/pref_registry_syncable.h" |
20 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
21 #include "grit/theme_resources.h" | 22 #include "grit/theme_resources.h" |
22 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
23 #include "url/gurl.h" | 24 #include "url/gurl.h" |
24 | 25 |
25 namespace { | 26 namespace { |
26 | 27 |
27 struct RawPrepopulatedPage { | 28 struct RawPrepopulatedPage { |
28 int url_id; // The resource for the page URL. | 29 int url_id; // The resource for the page URL. |
29 int title_id; // The resource for the page title. | 30 int title_id; // The resource for the page title. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 TopSitesFactory::~TopSitesFactory() { | 109 TopSitesFactory::~TopSitesFactory() { |
109 } | 110 } |
110 | 111 |
111 scoped_refptr<RefcountedKeyedService> TopSitesFactory::BuildServiceInstanceFor( | 112 scoped_refptr<RefcountedKeyedService> TopSitesFactory::BuildServiceInstanceFor( |
112 content::BrowserContext* context) const { | 113 content::BrowserContext* context) const { |
113 history::PrepopulatedPageList prepopulated_pages; | 114 history::PrepopulatedPageList prepopulated_pages; |
114 InitializePrepopulatedPageList(&prepopulated_pages); | 115 InitializePrepopulatedPageList(&prepopulated_pages); |
115 return BuildTopSites(context, prepopulated_pages); | 116 return BuildTopSites(context, prepopulated_pages); |
116 } | 117 } |
117 | 118 |
| 119 void TopSitesFactory::RegisterProfilePrefs( |
| 120 user_prefs::PrefRegistrySyncable* registry) { |
| 121 registry->RegisterDictionaryPref(prefs::kNtpMostVisitedURLsBlacklist); |
| 122 } |
| 123 |
118 bool TopSitesFactory::ServiceIsNULLWhileTesting() const { | 124 bool TopSitesFactory::ServiceIsNULLWhileTesting() const { |
119 return true; | 125 return true; |
120 } | 126 } |
OLD | NEW |