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

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

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
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 "ios/chrome/browser/history/top_sites_factory.h" 5 #include "ios/chrome/browser/history/top_sites_factory.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "components/history/core/browser/history_constants.h" 8 #include "components/history/core/browser/history_constants.h"
9 #include "components/history/core/browser/top_sites_impl.h" 9 #include "components/history/core/browser/top_sites_impl.h"
10 #include "components/keyed_service/core/refcounted_keyed_service.h" 10 #include "components/keyed_service/core/refcounted_keyed_service.h"
11 #include "components/keyed_service/core/service_access_type.h" 11 #include "components/keyed_service/core/service_access_type.h"
12 #include "components/keyed_service/ios/browser_state_dependency_manager.h" 12 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
13 #include "components/pref_registry/pref_registry_syncable.h" 13 #include "components/pref_registry/pref_registry_syncable.h"
14 #include "ios/chrome/browser/history/history_service_factory.h" 14 #include "ios/chrome/browser/history/history_service_factory.h"
15 #include "ios/chrome/browser/history/history_utils.h" 15 #include "ios/chrome/browser/history/history_utils.h"
16 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state. h" 16 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state. h"
17 #include "ios/web/public/web_thread.h" 17 #include "ios/web/public/web_thread.h"
18 18
19 namespace ios { 19 namespace ios {
20 20
21 // static 21 // static
22 scoped_refptr<history::TopSites> TopSitesFactory::GetForBrowserState( 22 scoped_refptr<history::TopSites> TopSitesFactory::GetForBrowserState(
23 ios::ChromeBrowserState* browser_state) { 23 ios::ChromeBrowserState* browser_state) {
24 return make_scoped_refptr(static_cast<history::TopSites*>( 24 return make_scoped_refptr(static_cast<history::TopSites*>(
25 GetInstance()->GetServiceForBrowserState(browser_state, true).get())); 25 GetInstance()->GetServiceForBrowserState(browser_state, true).get()));
26 } 26 }
27 27
28 // static 28 // static
29 TopSitesFactory* TopSitesFactory::GetInstance() { 29 TopSitesFactory* TopSitesFactory::GetInstance() {
30 return Singleton<TopSitesFactory>::get(); 30 return base::Singleton<TopSitesFactory>::get();
31 } 31 }
32 32
33 TopSitesFactory::TopSitesFactory() 33 TopSitesFactory::TopSitesFactory()
34 : RefcountedBrowserStateKeyedServiceFactory( 34 : RefcountedBrowserStateKeyedServiceFactory(
35 "TopSites", 35 "TopSites",
36 BrowserStateDependencyManager::GetInstance()) { 36 BrowserStateDependencyManager::GetInstance()) {
37 DependsOn(ios::HistoryServiceFactory::GetInstance()); 37 DependsOn(ios::HistoryServiceFactory::GetInstance());
38 } 38 }
39 39
40 TopSitesFactory::~TopSitesFactory() { 40 TopSitesFactory::~TopSitesFactory() {
(...skipping 17 matching lines...) Expand all
58 void TopSitesFactory::RegisterBrowserStatePrefs( 58 void TopSitesFactory::RegisterBrowserStatePrefs(
59 user_prefs::PrefRegistrySyncable* registry) { 59 user_prefs::PrefRegistrySyncable* registry) {
60 history::TopSitesImpl::RegisterPrefs(registry); 60 history::TopSitesImpl::RegisterPrefs(registry);
61 } 61 }
62 62
63 bool TopSitesFactory::ServiceIsNULLWhileTesting() const { 63 bool TopSitesFactory::ServiceIsNULLWhileTesting() const {
64 return true; 64 return true;
65 } 65 }
66 66
67 } // namespace ios 67 } // namespace ios
OLDNEW
« no previous file with comments | « ios/chrome/browser/history/top_sites_factory.h ('k') | ios/chrome/browser/history/web_history_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698