| 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 CHROME_BROWSER_FAVICON_CHROME_FALLBACK_ICON_CLIENT_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_FAVICON_CHROME_FALLBACK_ICON_CLIENT_FACTORY_H_ |
| 6 #define CHROME_BROWSER_FAVICON_CHROME_FALLBACK_ICON_CLIENT_FACTORY_H_ | 6 #define CHROME_BROWSER_FAVICON_CHROME_FALLBACK_ICON_CLIENT_FACTORY_H_ |
| 7 | 7 |
| 8 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 8 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 9 | 9 |
| 10 namespace base { |
| 10 template <typename T> struct DefaultSingletonTraits; | 11 template <typename T> struct DefaultSingletonTraits; |
| 12 } |
| 11 | 13 |
| 12 namespace content { | 14 namespace content { |
| 13 class BrowserContext; | 15 class BrowserContext; |
| 14 } | 16 } |
| 15 | 17 |
| 16 namespace favicon { | 18 namespace favicon { |
| 17 class FallbackIconClient; | 19 class FallbackIconClient; |
| 18 } | 20 } |
| 19 | 21 |
| 20 // Singleton that owns all ChromeFallbackIconClients and associates them with | 22 // Singleton that owns all ChromeFallbackIconClients and associates them with |
| 21 // Profiles. | 23 // Profiles. |
| 22 class ChromeFallbackIconClientFactory | 24 class ChromeFallbackIconClientFactory |
| 23 : public BrowserContextKeyedServiceFactory { | 25 : public BrowserContextKeyedServiceFactory { |
| 24 public: | 26 public: |
| 25 // Returns the instance of FallbackIconClient associated with this profile | 27 // Returns the instance of FallbackIconClient associated with this profile |
| 26 // (creating one if none exists). | 28 // (creating one if none exists). |
| 27 static favicon::FallbackIconClient* GetForBrowserContext( | 29 static favicon::FallbackIconClient* GetForBrowserContext( |
| 28 content::BrowserContext* context); | 30 content::BrowserContext* context); |
| 29 | 31 |
| 30 // Returns an instance of the factory singleton. | 32 // Returns an instance of the factory singleton. |
| 31 static ChromeFallbackIconClientFactory* GetInstance(); | 33 static ChromeFallbackIconClientFactory* GetInstance(); |
| 32 | 34 |
| 33 private: | 35 private: |
| 34 friend struct DefaultSingletonTraits<ChromeFallbackIconClientFactory>; | 36 friend struct base::DefaultSingletonTraits<ChromeFallbackIconClientFactory>; |
| 35 | 37 |
| 36 ChromeFallbackIconClientFactory(); | 38 ChromeFallbackIconClientFactory(); |
| 37 ~ChromeFallbackIconClientFactory() override; | 39 ~ChromeFallbackIconClientFactory() override; |
| 38 | 40 |
| 39 // BrowserContextKeyedServiceFactory: | 41 // BrowserContextKeyedServiceFactory: |
| 40 KeyedService* BuildServiceInstanceFor( | 42 KeyedService* BuildServiceInstanceFor( |
| 41 content::BrowserContext* context) const override; | 43 content::BrowserContext* context) const override; |
| 42 }; | 44 }; |
| 43 | 45 |
| 44 #endif // CHROME_BROWSER_FAVICON_CHROME_FALLBACK_ICON_CLIENT_FACTORY_H_ | 46 #endif // CHROME_BROWSER_FAVICON_CHROME_FALLBACK_ICON_CLIENT_FACTORY_H_ |
| OLD | NEW |