| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |