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

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: Making FallbackIconSource take FallbackIconService directly. 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 "base/memory/singleton.h"
9 #include "chrome/browser/favicon/chrome_fallback_icon_client.h"
sdefresne 2015/03/17 09:41:52 You don't need to #include those two files (single
huangs 2015/03/23 03:28:34 Done.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698