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

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: Comment fix; removing usage of Profile in factories. Created 5 years, 8 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
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_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ 5 #ifndef CHROME_BROWSER_FAVICON_CHROME_FALLBACK_ICON_CLIENT_FACTORY_H_
6 #define CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ 6 #define CHROME_BROWSER_FAVICON_CHROME_FALLBACK_ICON_CLIENT_FACTORY_H_
7 7
8 #include "base/macros.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" 8 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
10 9
10 template <typename T> struct DefaultSingletonTraits;
11
12 class FallbackIconClient;
13
11 namespace content { 14 namespace content {
12 class BrowserContext; 15 class BrowserContext;
13 } // namespace content 16 }
14 17
15 template <typename T> struct DefaultSingletonTraits; 18 // Singleton that owns all ChromeFallbackIconClients and associates them with
16 19 // Profiles.
17 class EnhancedBookmarkKeyService; 20 class ChromeFallbackIconClientFactory
18
19 // Singleton that owns all EnhancedBookmarkKeyServices and associates them with
20 // BrowserContexts.
21 class EnhancedBookmarkKeyServiceFactory
22 : public BrowserContextKeyedServiceFactory { 21 : public BrowserContextKeyedServiceFactory {
23 public: 22 public:
24 static EnhancedBookmarkKeyServiceFactory* GetInstance(); 23 // Returns the instance of FallbackIconClient associated with this profile
24 // (creating one if none exists).
25 static FallbackIconClient* GetForBrowserContext(
26 content::BrowserContext* context);
27
28 // Returns an instance of the factory singleton.
29 static ChromeFallbackIconClientFactory* GetInstance();
25 30
26 private: 31 private:
27 friend struct DefaultSingletonTraits<EnhancedBookmarkKeyServiceFactory>; 32 friend struct DefaultSingletonTraits<ChromeFallbackIconClientFactory>;
28 33
29 EnhancedBookmarkKeyServiceFactory(); 34 ChromeFallbackIconClientFactory();
30 ~EnhancedBookmarkKeyServiceFactory() override; 35 ~ChromeFallbackIconClientFactory() override;
31 36
32 // BrowserContextKeyedServiceFactory: 37 // BrowserContextKeyedServiceFactory:
33 KeyedService* BuildServiceInstanceFor( 38 KeyedService* BuildServiceInstanceFor(
34 content::BrowserContext* context) const override; 39 content::BrowserContext* /* context */) const override;
pkotwicz 2015/03/27 18:47:57 Nit: Don't comment out |context| in the header
huangs 2015/03/27 19:01:51 I thought that's standard practice to specify that
35 content::BrowserContext* GetBrowserContextToUse( 40 content::BrowserContext* GetBrowserContextToUse(
36 content::BrowserContext* context) const override; 41 content::BrowserContext* context) const override;
37 bool ServiceIsCreatedWithBrowserContext() const override;
38 bool ServiceIsNULLWhileTesting() const override;
39
40 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarkKeyServiceFactory);
41 }; 42 };
42 43
43 #endif // CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ 44 #endif // CHROME_BROWSER_FAVICON_CHROME_FALLBACK_ICON_CLIENT_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698