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

Unified Diff: chrome/browser/extensions/chrome_app_icon_service_factory.cc

Issue 2819413003: Refactor extension app icon. (Closed)
Patch Set: nit Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/chrome_app_icon_service_factory.cc
diff --git a/chrome/browser/extensions/chrome_app_icon_service_factory.cc b/chrome/browser/extensions/chrome_app_icon_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7eea54f8f59016337127faf8aa13b8cf4c82389f
--- /dev/null
+++ b/chrome/browser/extensions/chrome_app_icon_service_factory.cc
@@ -0,0 +1,45 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/chrome_app_icon_service_factory.h"
+
+#include "chrome/browser/extensions/chrome_app_icon_service.h"
+#include "chrome/browser/profiles/incognito_helpers.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "extensions/browser/extension_registry_factory.h"
+
+namespace extensions {
+
+// static
+ChromeAppIconService* ChromeAppIconServiceFactory::GetForBrowserContext(
+ content::BrowserContext* context) {
+ return static_cast<ChromeAppIconService*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+// static
+ChromeAppIconServiceFactory* ChromeAppIconServiceFactory::GetInstance() {
+ return base::Singleton<ChromeAppIconServiceFactory>::get();
+}
+
+ChromeAppIconServiceFactory::ChromeAppIconServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "ChromeAppIconService",
+ BrowserContextDependencyManager::GetInstance()) {
+ DependsOn(ExtensionRegistryFactory::GetInstance());
+}
+
+ChromeAppIconServiceFactory::~ChromeAppIconServiceFactory() = default;
+
+KeyedService* ChromeAppIconServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return new ChromeAppIconService(context);
+}
+
+content::BrowserContext* ChromeAppIconServiceFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ return chrome::GetBrowserContextRedirectedInIncognito(context);
+}
+
+} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/chrome_app_icon_service_factory.h ('k') | chrome/browser/extensions/chrome_app_icon_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698