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/public/test/test_keyed_service_provider.h" | 5 #include "ios/public/test/test_keyed_service_provider.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
11 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 11 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
12 #include "components/keyed_service/core/keyed_service.h" | 12 #include "components/keyed_service/core/keyed_service.h" |
13 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 13 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
14 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" | 14 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" |
15 #include "components/sync_driver/fake_sync_service.h" | 15 #include "components/sync_driver/fake_sync_service.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/public/test/fake_sync_service_factory.h" | 17 #include "ios/public/test/fake_sync_service_factory.h" |
18 | 18 |
19 namespace ios { | 19 namespace ios { |
20 namespace { | 20 namespace { |
21 | 21 |
22 class MissingServiceKeyedServiceFactory | 22 class MissingServiceKeyedServiceFactory |
23 : public BrowserStateKeyedServiceFactory { | 23 : public BrowserStateKeyedServiceFactory { |
24 public: | 24 public: |
25 static MissingServiceKeyedServiceFactory* GetInstance(); | 25 static MissingServiceKeyedServiceFactory* GetInstance(); |
26 | 26 |
27 private: | 27 private: |
28 friend struct DefaultSingletonTraits<MissingServiceKeyedServiceFactory>; | 28 friend struct base::DefaultSingletonTraits<MissingServiceKeyedServiceFactory>; |
29 | 29 |
30 MissingServiceKeyedServiceFactory(); | 30 MissingServiceKeyedServiceFactory(); |
31 ~MissingServiceKeyedServiceFactory() override; | 31 ~MissingServiceKeyedServiceFactory() override; |
32 | 32 |
33 // BrowserStateKeyedServiceFactory implementation. | 33 // BrowserStateKeyedServiceFactory implementation. |
34 scoped_ptr<KeyedService> BuildServiceInstanceFor( | 34 scoped_ptr<KeyedService> BuildServiceInstanceFor( |
35 web::BrowserState* context) const override; | 35 web::BrowserState* context) const override; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(MissingServiceKeyedServiceFactory); | 37 DISALLOW_COPY_AND_ASSIGN(MissingServiceKeyedServiceFactory); |
38 }; | 38 }; |
39 | 39 |
40 // static | 40 // static |
41 MissingServiceKeyedServiceFactory* | 41 MissingServiceKeyedServiceFactory* |
42 MissingServiceKeyedServiceFactory::GetInstance() { | 42 MissingServiceKeyedServiceFactory::GetInstance() { |
43 return Singleton<MissingServiceKeyedServiceFactory>::get(); | 43 return base::Singleton<MissingServiceKeyedServiceFactory>::get(); |
44 } | 44 } |
45 | 45 |
46 MissingServiceKeyedServiceFactory::MissingServiceKeyedServiceFactory() | 46 MissingServiceKeyedServiceFactory::MissingServiceKeyedServiceFactory() |
47 : BrowserStateKeyedServiceFactory( | 47 : BrowserStateKeyedServiceFactory( |
48 "MissingService", | 48 "MissingService", |
49 BrowserStateDependencyManager::GetInstance()) { | 49 BrowserStateDependencyManager::GetInstance()) { |
50 } | 50 } |
51 | 51 |
52 MissingServiceKeyedServiceFactory::~MissingServiceKeyedServiceFactory() { | 52 MissingServiceKeyedServiceFactory::~MissingServiceKeyedServiceFactory() { |
53 } | 53 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 return MissingServiceKeyedServiceFactory::GetInstance(); | 93 return MissingServiceKeyedServiceFactory::GetInstance(); |
94 } | 94 } |
95 | 95 |
96 invalidation::ProfileInvalidationProvider* | 96 invalidation::ProfileInvalidationProvider* |
97 TestKeyedServiceProvider::GetProfileInvalidationProviderForBrowserState( | 97 TestKeyedServiceProvider::GetProfileInvalidationProviderForBrowserState( |
98 ios::ChromeBrowserState* browser_state) { | 98 ios::ChromeBrowserState* browser_state) { |
99 return nullptr; | 99 return nullptr; |
100 } | 100 } |
101 | 101 |
102 } // namespace ios | 102 } // namespace ios |
OLD | NEW |