1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_FAVICON_CHROME_FAVICON_CLIENT_FACTORY_H_
6 #define CHROME_BROWSER_FAVICON_CHROME_FAVICON_CLIENT_FACTORY_H_
8 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
11 struct DefaultSingletonTraits
;
19 // Singleton that owns all ChromeFaviconClients and associates them with
21 class ChromeFaviconClientFactory
: public BrowserContextKeyedServiceFactory
{
23 // Returns the instance of favicon::FaviconClient associated with |profile|
24 // (creating one if none exists).
25 static favicon::FaviconClient
* GetForProfile(Profile
* profile
);
27 // Returns an instance of the factory singleton.
28 static ChromeFaviconClientFactory
* GetInstance();
31 friend struct DefaultSingletonTraits
<ChromeFaviconClientFactory
>;
33 ChromeFaviconClientFactory();
34 ~ChromeFaviconClientFactory() override
;
36 // BrowserContextKeyedServiceFactory:
37 KeyedService
* BuildServiceInstanceFor(
38 content::BrowserContext
* profile
) const override
;
39 content::BrowserContext
* GetBrowserContextToUse(
40 content::BrowserContext
* context
) const override
;
43 #endif // CHROME_BROWSER_FAVICON_CHROME_FAVICON_CLIENT_FACTORY_H_