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

Side by Side Diff: chrome/browser/extensions/extension_app_icon_service_factory.cc

Issue 2819413003: Refactor extension app icon. (Closed)
Patch Set: Created 3 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
(Empty)
1 // Copyright 2017 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 #include "chrome/browser/extensions/extension_app_icon_service_factory.h"
6
7 #include "chrome/browser/extensions/extension_app_icon_service.h"
8 #include "chrome/browser/profiles/incognito_helpers.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10
11 namespace extensions {
12
13 // static
14 ExtensionAppIconService* ExtensionAppIconServiceFactory::GetForBrowserContext(
15 content::BrowserContext* context) {
16 return static_cast<ExtensionAppIconService*>(
17 GetInstance()->GetServiceForBrowserContext(context, true));
18 }
19
20 // static
21 ExtensionAppIconServiceFactory* ExtensionAppIconServiceFactory::GetInstance() {
22 return base::Singleton<ExtensionAppIconServiceFactory>::get();
23 }
24
25 ExtensionAppIconServiceFactory::ExtensionAppIconServiceFactory()
26 : BrowserContextKeyedServiceFactory(
27 "ExtensionAppIconService",
28 BrowserContextDependencyManager::GetInstance()) {}
xiyuan 2017/04/18 20:43:01 DependsOn(ExtensionRegistryFactory::GetInstance())
khmel 2017/04/20 00:13:38 Thanks for catching this! actually I was seeking t
29
30 ExtensionAppIconServiceFactory::~ExtensionAppIconServiceFactory() = default;
31
32 KeyedService* ExtensionAppIconServiceFactory::BuildServiceInstanceFor(
33 content::BrowserContext* context) const {
34 return ExtensionAppIconService::Create(context);
35 }
36
37 content::BrowserContext* ExtensionAppIconServiceFactory::GetBrowserContextToUse(
38 content::BrowserContext* context) const {
39 // This matches the logic in ExtensionSyncServiceFactory, which uses the
40 // original browser context.
41 return chrome::GetBrowserContextRedirectedInIncognito(context);
42 }
43
44 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698