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 #ifndef IOS_CHROME_BROWSER_WEB_DATA_SERVICE_FACTORY_H_ | 5 #ifndef IOS_CHROME_BROWSER_WEB_DATA_SERVICE_FACTORY_H_ |
6 #define IOS_CHROME_BROWSER_WEB_DATA_SERVICE_FACTORY_H_ | 6 #define IOS_CHROME_BROWSER_WEB_DATA_SERVICE_FACTORY_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" | 11 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" |
12 | 12 |
13 template <typename T> | 13 template <typename T> |
14 struct DefaultSingletonTraits; | 14 struct DefaultSingletonTraits; |
15 class KeywordWebDataService; | 15 class KeywordWebDataService; |
16 class TokenWebData; | 16 class TokenWebData; |
17 class WebDataServiceWrapper; | 17 class WebDataServiceWrapper; |
18 enum class ServiceAccessType; | 18 enum class ServiceAccessType; |
19 | 19 |
20 namespace autofill { | 20 namespace autofill { |
21 class AutofillWebDataService; | 21 class AutofillWebDataService; |
22 } | 22 } |
23 | 23 |
24 namespace ios { | 24 namespace ios { |
25 | 25 |
26 class ChromeBrowserState; | 26 class ChromeBrowserState; |
27 | 27 |
28 // Singleton that owns all WebDataServiceWrapper and associates them with | 28 // Singleton that owns all WebDataServiceWrappers and associates them with |
29 // ios::ChromeBrowserState. | 29 // ios::ChromeBrowserState. |
30 class WebDataServiceFactory : public BrowserStateKeyedServiceFactory { | 30 class WebDataServiceFactory : public BrowserStateKeyedServiceFactory { |
31 public: | 31 public: |
32 // Returns the AutofillWebDataService associated with |browser_state|. | 32 // Returns the AutofillWebDataService associated with |browser_state|. |
33 static WebDataServiceWrapper* GetForBrowserState( | 33 static WebDataServiceWrapper* GetForBrowserState( |
34 ios::ChromeBrowserState* browser_state, | 34 ios::ChromeBrowserState* browser_state, |
35 ServiceAccessType access_type); | 35 ServiceAccessType access_type); |
36 static WebDataServiceWrapper* GetForBrowserStateIfExists( | 36 static WebDataServiceWrapper* GetForBrowserStateIfExists( |
37 ios::ChromeBrowserState* browser_state, | 37 ios::ChromeBrowserState* browser_state, |
38 ServiceAccessType access_type); | 38 ServiceAccessType access_type); |
(...skipping 27 matching lines...) Expand all Loading... |
66 web::BrowserState* GetBrowserStateToUse( | 66 web::BrowserState* GetBrowserStateToUse( |
67 web::BrowserState* context) const override; | 67 web::BrowserState* context) const override; |
68 bool ServiceIsNULLWhileTesting() const override; | 68 bool ServiceIsNULLWhileTesting() const override; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(WebDataServiceFactory); | 70 DISALLOW_COPY_AND_ASSIGN(WebDataServiceFactory); |
71 }; | 71 }; |
72 | 72 |
73 } // namespace ios | 73 } // namespace ios |
74 | 74 |
75 #endif // IOS_CHROME_BROWSER_WEB_DATA_SERVICE_FACTORY_H_ | 75 #endif // IOS_CHROME_BROWSER_WEB_DATA_SERVICE_FACTORY_H_ |
OLD | NEW |