Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: chrome/browser/favicon/chrome_fallback_icon_client_factory.h

Issue 996253002: [Fallback Icons] Refactor FallbackIconService to be a BrowserContext-level singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and merge. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 "components/keyed_service/content/browser_context_keyed_service_factory .h"
9
10 template <typename T> struct DefaultSingletonTraits;
11
12 class FallbackIconClient;
13 class Profile;
14
15 // Singleton that owns all ChromeFallbackIconClients and associates them with
16 // Profiles.
17 class ChromeFallbackIconClientFactory
18 : public BrowserContextKeyedServiceFactory {
19 public:
20 // Returns the instance of FallbackIconClient associated with this profile
21 // (creating one if none exists).
22 static FallbackIconClient* GetForProfile(Profile* profile);
23
24 // Returns an instance of the factory singleton.
25 static ChromeFallbackIconClientFactory* GetInstance();
26
27 private:
28 friend struct DefaultSingletonTraits<ChromeFallbackIconClientFactory>;
29
30 ChromeFallbackIconClientFactory();
31 ~ChromeFallbackIconClientFactory() override;
32
33 // BrowserContextKeyedServiceFactory:
34 KeyedService* BuildServiceInstanceFor(
35 content::BrowserContext* profile) const override;
36 content::BrowserContext* GetBrowserContextToUse(
37 content::BrowserContext* context) const override;
38 };
39
40 #endif // CHROME_BROWSER_FAVICON_CHROME_FALLBACK_ICON_CLIENT_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698