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

Side by Side Diff: chrome/browser/favicon/fallback_icon_service_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_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_ 5 #ifndef CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_ 6 #define CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_
7 7
8 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" 8 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
9 9
10 template <typename T> struct DefaultSingletonTraits; 10 template <typename T> struct DefaultSingletonTraits;
11 11
12 class InMemoryURLIndex; 12 class FallbackIconService;
13 class Profile;
14 13
15 class InMemoryURLIndexFactory : public BrowserContextKeyedServiceFactory { 14 namespace content {
15 class BrowserContext;
16 }
17
18 // Singleton that owns all FallbackIconService and associates them with
19 // Profiles.
pkotwicz 2015/03/27 18:47:57 Nit: Profiles -> BrowserContexts
huangs 2015/03/27 19:01:51 Done.
20 class FallbackIconServiceFactory : public BrowserContextKeyedServiceFactory {
16 public: 21 public:
17 static InMemoryURLIndex* GetForProfile(Profile* profile); 22 static FallbackIconService* GetForBrowserContext(
18 static InMemoryURLIndexFactory* GetInstance(); 23 content::BrowserContext* context);
24
25 static FallbackIconServiceFactory* GetInstance();
19 26
20 private: 27 private:
21 friend struct DefaultSingletonTraits<InMemoryURLIndexFactory>; 28 friend struct DefaultSingletonTraits<FallbackIconServiceFactory>;
22 29
23 InMemoryURLIndexFactory(); 30 FallbackIconServiceFactory();
24 ~InMemoryURLIndexFactory() override; 31 ~FallbackIconServiceFactory() override;
25 32
26 // BrowserContextKeyedServiceFactory: 33 // BrowserContextKeyedServiceFactory:
27 KeyedService* BuildServiceInstanceFor( 34 KeyedService* BuildServiceInstanceFor(
28 content::BrowserContext* context) const override; 35 content::BrowserContext* context) const override;
29 content::BrowserContext* GetBrowserContextToUse(
30 content::BrowserContext* context) const override;
31 bool ServiceIsNULLWhileTesting() const override; 36 bool ServiceIsNULLWhileTesting() const override;
37
38 DISALLOW_COPY_AND_ASSIGN(FallbackIconServiceFactory);
32 }; 39 };
33 40
34 #endif // CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_ 41 #endif // CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698