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

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

Issue 1222013005: Implements WebHistoryServiceFactory on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 5 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 if (access_type != ServiceAccessType::EXPLICIT_ACCESS && 43 if (access_type != ServiceAccessType::EXPLICIT_ACCESS &&
44 browser_state->GetPrefs()->GetBoolean( 44 browser_state->GetPrefs()->GetBoolean(
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 HistoryServiceFactory* HistoryServiceFactory::GetInstance() { 54 HistoryServiceFactory* HistoryServiceFactory::GetInstance() {
54 return Singleton<HistoryServiceFactory>::get(); 55 return Singleton<HistoryServiceFactory>::get();
55 } 56 }
56 57
57 HistoryServiceFactory::HistoryServiceFactory() 58 HistoryServiceFactory::HistoryServiceFactory()
58 : BrowserStateKeyedServiceFactory( 59 : BrowserStateKeyedServiceFactory(
59 "HistoryService", 60 "HistoryService",
60 BrowserStateDependencyManager::GetInstance()) { 61 BrowserStateDependencyManager::GetInstance()) {
61 DependsOn(GetKeyedServiceProvider()->GetBookmarkModelFactory()); 62 DependsOn(GetKeyedServiceProvider()->GetBookmarkModelFactory());
62 } 63 }
(...skipping 23 matching lines...) Expand all
86 web::BrowserState* HistoryServiceFactory::GetBrowserStateToUse( 87 web::BrowserState* HistoryServiceFactory::GetBrowserStateToUse(
87 web::BrowserState* context) const { 88 web::BrowserState* context) const {
88 return GetBrowserStateRedirectedInIncognito(context); 89 return GetBrowserStateRedirectedInIncognito(context);
89 } 90 }
90 91
91 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { 92 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const {
92 return true; 93 return true;
93 } 94 }
94 95
95 } // namespace ios 96 } // namespace ios
OLDNEW
« no previous file with comments | « ios/chrome/browser/history/history_service_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