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