OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_history_service_factory.h" | 5 #include "chrome/browser/history/web_history_service_factory.h" |
6 | 6 |
7 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 7 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
8 #include "chrome/browser/signin/signin_manager_factory.h" | 8 #include "chrome/browser/signin/signin_manager_factory.h" |
9 #include "chrome/browser/sync/profile_sync_service.h" | 9 #include "chrome/browser/sync/profile_sync_service.h" |
10 #include "chrome/browser/sync/profile_sync_service_factory.h" | 10 #include "chrome/browser/sync/profile_sync_service_factory.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); | 22 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); |
23 return sync && | 23 return sync && |
24 sync->IsSyncActive() && | 24 sync->IsSyncActive() && |
25 sync->GetActiveDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES); | 25 sync->GetActiveDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES); |
26 } | 26 } |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 // static | 30 // static |
31 WebHistoryServiceFactory* WebHistoryServiceFactory::GetInstance() { | 31 WebHistoryServiceFactory* WebHistoryServiceFactory::GetInstance() { |
32 return Singleton<WebHistoryServiceFactory>::get(); | 32 return base::Singleton<WebHistoryServiceFactory>::get(); |
33 } | 33 } |
34 | 34 |
35 // static | 35 // static |
36 history::WebHistoryService* WebHistoryServiceFactory::GetForProfile( | 36 history::WebHistoryService* WebHistoryServiceFactory::GetForProfile( |
37 Profile* profile) { | 37 Profile* profile) { |
38 if (!IsHistorySyncEnabled(profile)) | 38 if (!IsHistorySyncEnabled(profile)) |
39 return nullptr; | 39 return nullptr; |
40 | 40 |
41 return static_cast<history::WebHistoryService*>( | 41 return static_cast<history::WebHistoryService*>( |
42 GetInstance()->GetServiceForBrowserContext(profile, true)); | 42 GetInstance()->GetServiceForBrowserContext(profile, true)); |
(...skipping 16 matching lines...) Expand all Loading... |
59 WebHistoryServiceFactory::WebHistoryServiceFactory() | 59 WebHistoryServiceFactory::WebHistoryServiceFactory() |
60 : BrowserContextKeyedServiceFactory( | 60 : BrowserContextKeyedServiceFactory( |
61 "WebHistoryServiceFactory", | 61 "WebHistoryServiceFactory", |
62 BrowserContextDependencyManager::GetInstance()) { | 62 BrowserContextDependencyManager::GetInstance()) { |
63 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); | 63 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); |
64 DependsOn(SigninManagerFactory::GetInstance()); | 64 DependsOn(SigninManagerFactory::GetInstance()); |
65 } | 65 } |
66 | 66 |
67 WebHistoryServiceFactory::~WebHistoryServiceFactory() { | 67 WebHistoryServiceFactory::~WebHistoryServiceFactory() { |
68 } | 68 } |
OLD | NEW |