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

Side by Side Diff: ios/chrome/browser/history/history_service_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/history_service_factory.h" 5 #include "ios/chrome/browser/history/history_service_factory.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "components/history/core/browser/history_database_params.h" 9 #include "components/history/core/browser/history_database_params.h"
10 #include "components/history/core/browser/history_service.h" 10 #include "components/history/core/browser/history_service.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ios::prefs::kSavingBrowserHistoryDisabled)) { 45 ios::prefs::kSavingBrowserHistoryDisabled)) {
46 return nullptr; 46 return nullptr;
47 } 47 }
48 48
49 return static_cast<history::HistoryService*>( 49 return static_cast<history::HistoryService*>(
50 GetInstance()->GetServiceForBrowserState(browser_state, true)); 50 GetInstance()->GetServiceForBrowserState(browser_state, true));
51 } 51 }
52 52
53 // static 53 // static
54 HistoryServiceFactory* HistoryServiceFactory::GetInstance() { 54 HistoryServiceFactory* HistoryServiceFactory::GetInstance() {
55 return Singleton<HistoryServiceFactory>::get(); 55 return base::Singleton<HistoryServiceFactory>::get();
56 } 56 }
57 57
58 HistoryServiceFactory::HistoryServiceFactory() 58 HistoryServiceFactory::HistoryServiceFactory()
59 : BrowserStateKeyedServiceFactory( 59 : BrowserStateKeyedServiceFactory(
60 "HistoryService", 60 "HistoryService",
61 BrowserStateDependencyManager::GetInstance()) { 61 BrowserStateDependencyManager::GetInstance()) {
62 DependsOn(ios::BookmarkModelFactory::GetInstance()); 62 DependsOn(ios::BookmarkModelFactory::GetInstance());
63 } 63 }
64 64
65 HistoryServiceFactory::~HistoryServiceFactory() { 65 HistoryServiceFactory::~HistoryServiceFactory() {
(...skipping 20 matching lines...) Expand all
86 web::BrowserState* HistoryServiceFactory::GetBrowserStateToUse( 86 web::BrowserState* HistoryServiceFactory::GetBrowserStateToUse(
87 web::BrowserState* context) const { 87 web::BrowserState* context) const {
88 return GetBrowserStateRedirectedInIncognito(context); 88 return GetBrowserStateRedirectedInIncognito(context);
89 } 89 }
90 90
91 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { 91 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const {
92 return true; 92 return true;
93 } 93 }
94 94
95 } // namespace ios 95 } // namespace ios
OLDNEW
« no previous file with comments | « ios/chrome/browser/history/history_service_factory.h ('k') | ios/chrome/browser/history/top_sites_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698