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_FAVICON_FAVICON_SERVICE_FACTORY_H_ | 5 #ifndef IOS_CHROME_BROWSER_FAVICON_FAVICON_SERVICE_FACTORY_H_ |
6 #define IOS_CHROME_BROWSER_FAVICON_FAVICON_SERVICE_FACTORY_H_ | 6 #define IOS_CHROME_BROWSER_FAVICON_FAVICON_SERVICE_FACTORY_H_ |
7 | 7 |
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 "components/keyed_service/ios/browser_state_keyed_service_factory.h" | 10 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" |
11 | 11 |
12 template <typename T> | 12 template <typename T> |
13 struct DefaultSingletonTraits; | 13 struct base::DefaultSingletonTraits; |
sdefresne
2015/08/24 10:03:33
Are you sure this work? Shouldn't this instead be
| |
14 enum class ServiceAccessType; | 14 enum class ServiceAccessType; |
15 | 15 |
16 namespace favicon { | 16 namespace favicon { |
17 class FaviconService; | 17 class FaviconService; |
18 } | 18 } |
19 | 19 |
20 namespace ios { | 20 namespace ios { |
21 | 21 |
22 class ChromeBrowserState; | 22 class ChromeBrowserState; |
23 | 23 |
24 // Singleton that owns all FaviconServices and associates them with | 24 // Singleton that owns all FaviconServices and associates them with |
25 // ios::ChromeBrowserState. | 25 // ios::ChromeBrowserState. |
26 class FaviconServiceFactory : public BrowserStateKeyedServiceFactory { | 26 class FaviconServiceFactory : public BrowserStateKeyedServiceFactory { |
27 public: | 27 public: |
28 static favicon::FaviconService* GetForBrowserState( | 28 static favicon::FaviconService* GetForBrowserState( |
29 ios::ChromeBrowserState* browser_state, | 29 ios::ChromeBrowserState* browser_state, |
30 ServiceAccessType access_type); | 30 ServiceAccessType access_type); |
31 static FaviconServiceFactory* GetInstance(); | 31 static FaviconServiceFactory* GetInstance(); |
32 | 32 |
33 private: | 33 private: |
34 friend struct DefaultSingletonTraits<FaviconServiceFactory>; | 34 friend struct base::DefaultSingletonTraits<FaviconServiceFactory>; |
35 | 35 |
36 FaviconServiceFactory(); | 36 FaviconServiceFactory(); |
37 ~FaviconServiceFactory() override; | 37 ~FaviconServiceFactory() override; |
38 | 38 |
39 // BrowserStateKeyedServiceFactory implementation. | 39 // BrowserStateKeyedServiceFactory implementation. |
40 scoped_ptr<KeyedService> BuildServiceInstanceFor( | 40 scoped_ptr<KeyedService> BuildServiceInstanceFor( |
41 web::BrowserState* context) const override; | 41 web::BrowserState* context) const override; |
42 bool ServiceIsNULLWhileTesting() const override; | 42 bool ServiceIsNULLWhileTesting() const override; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(FaviconServiceFactory); | 44 DISALLOW_COPY_AND_ASSIGN(FaviconServiceFactory); |
45 }; | 45 }; |
46 | 46 |
47 } // namespace ios | 47 } // namespace ios |
48 | 48 |
49 #endif // IOS_CHROME_BROWSER_FAVICON_FAVICON_SERVICE_FACTORY_H_ | 49 #endif // IOS_CHROME_BROWSER_FAVICON_FAVICON_SERVICE_FACTORY_H_ |
OLD | NEW |