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

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

Issue 698623002: Split WarningService from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: virtual -> override Created 6 years, 1 month 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/extension_warning_badge_service_factory.cc
diff --git a/chrome/browser/extensions/extension_warning_badge_service_factory.cc b/chrome/browser/extensions/extension_warning_badge_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..09b85f3d162185b2a6081f67133b581a221fa1a1
--- /dev/null
+++ b/chrome/browser/extensions/extension_warning_badge_service_factory.cc
@@ -0,0 +1,57 @@
+// Copyright 2014 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/extension_warning_badge_service_factory.h"
+
+#include "chrome/browser/extensions/extension_warning_badge_service.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "extensions/browser/extensions_browser_client.h"
+#include "extensions/browser/warning_service_factory.h"
+
+using content::BrowserContext;
+
+namespace extensions {
+
+// static
+ExtensionWarningBadgeService*
+ExtensionWarningBadgeServiceFactory::GetForBrowserContext(
+ BrowserContext* context) {
+ return static_cast<ExtensionWarningBadgeService*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+// static
+ExtensionWarningBadgeServiceFactory*
+ExtensionWarningBadgeServiceFactory::GetInstance() {
+ return Singleton<ExtensionWarningBadgeServiceFactory>::get();
+}
+
+ExtensionWarningBadgeServiceFactory::ExtensionWarningBadgeServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "ExtensionWarningBadgeService",
+ BrowserContextDependencyManager::GetInstance()) {
+ DependsOn(WarningServiceFactory::GetInstance());
+}
+
+ExtensionWarningBadgeServiceFactory::~ExtensionWarningBadgeServiceFactory() {
+}
+
+KeyedService* ExtensionWarningBadgeServiceFactory::BuildServiceInstanceFor(
+ BrowserContext* context) const {
+ return new ExtensionWarningBadgeService(static_cast<Profile*>(context));
+}
+
+BrowserContext* ExtensionWarningBadgeServiceFactory::GetBrowserContextToUse(
+ BrowserContext* context) const {
+ // Redirected in incognito.
+ return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
+}
+
+bool ExtensionWarningBadgeServiceFactory::ServiceIsCreatedWithBrowserContext()
+ const {
+ return true;
+}
+
+} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/extension_warning_badge_service_factory.h ('k') | chrome/browser/extensions/test_extension_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698