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

Side by Side Diff: chrome/browser/history/top_sites_factory.cc

Issue 1151563005: Revert of NTP Zombie Code Slayer Part IV: Most Visited (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « chrome/browser/history/top_sites_factory.h ('k') | chrome/browser/resources/ntp4/apps_page.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
21 #include "content/public/browser/browser_thread.h" 20 #include "content/public/browser/browser_thread.h"
22 #include "grit/theme_resources.h" 21 #include "grit/theme_resources.h"
23 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
24 #include "url/gurl.h" 23 #include "url/gurl.h"
25 24
26 namespace { 25 namespace {
27 26
28 struct RawPrepopulatedPage { 27 struct RawPrepopulatedPage {
29 int url_id; // The resource for the page URL. 28 int url_id; // The resource for the page URL.
30 int title_id; // The resource for the page title. 29 int title_id; // The resource for the page title.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 TopSitesFactory::~TopSitesFactory() { 108 TopSitesFactory::~TopSitesFactory() {
110 } 109 }
111 110
112 scoped_refptr<RefcountedKeyedService> TopSitesFactory::BuildServiceInstanceFor( 111 scoped_refptr<RefcountedKeyedService> TopSitesFactory::BuildServiceInstanceFor(
113 content::BrowserContext* context) const { 112 content::BrowserContext* context) const {
114 history::PrepopulatedPageList prepopulated_pages; 113 history::PrepopulatedPageList prepopulated_pages;
115 InitializePrepopulatedPageList(&prepopulated_pages); 114 InitializePrepopulatedPageList(&prepopulated_pages);
116 return BuildTopSites(context, prepopulated_pages); 115 return BuildTopSites(context, prepopulated_pages);
117 } 116 }
118 117
119 void TopSitesFactory::RegisterProfilePrefs(
120 user_prefs::PrefRegistrySyncable* registry) {
121 registry->RegisterDictionaryPref(prefs::kNtpMostVisitedURLsBlacklist);
122 }
123
124 bool TopSitesFactory::ServiceIsNULLWhileTesting() const { 118 bool TopSitesFactory::ServiceIsNULLWhileTesting() const {
125 return true; 119 return true;
126 } 120 }
OLDNEW
« no previous file with comments | « chrome/browser/history/top_sites_factory.h ('k') | chrome/browser/resources/ntp4/apps_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698