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

Unified Diff: chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router_factory.cc

Issue 1096143003: Add chrome.searchEnginesPrivate API and Search Settings page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename some things on the idl to match latest api spec. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router_factory.cc
diff --git a/chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router_factory.cc b/chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1571fcc997e2afd0b5468d544e1679ef2a8eb2aa
--- /dev/null
+++ b/chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router_factory.cc
@@ -0,0 +1,59 @@
+// Copyright 2015 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/api/search_engines_private/search_engines_private_event_router.h"
+#include "chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router_factory.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "content/public/browser/browser_context.h"
+#include "extensions/browser/extension_system_provider.h"
+#include "extensions/browser/extensions_browser_client.h"
+
+namespace extensions {
+
+// static
+SearchEnginesPrivateEventRouter*
+SearchEnginesPrivateEventRouterFactory::GetForProfile(
+ content::BrowserContext* context) {
+ return static_cast<SearchEnginesPrivateEventRouter*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+// static
+SearchEnginesPrivateEventRouterFactory*
+SearchEnginesPrivateEventRouterFactory::GetInstance() {
+ return Singleton<SearchEnginesPrivateEventRouterFactory>::get();
+}
+
+SearchEnginesPrivateEventRouterFactory::SearchEnginesPrivateEventRouterFactory()
+ : BrowserContextKeyedServiceFactory(
+ "SearchEnginesPrivateEventRouter",
+ BrowserContextDependencyManager::GetInstance()) {
+ DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
+}
+
+SearchEnginesPrivateEventRouterFactory::
+ ~SearchEnginesPrivateEventRouterFactory() {
+}
+
+KeyedService* SearchEnginesPrivateEventRouterFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return SearchEnginesPrivateEventRouter::Create(context);
+}
+
+content::BrowserContext*
+SearchEnginesPrivateEventRouterFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
+}
+
+bool SearchEnginesPrivateEventRouterFactory::
+ ServiceIsCreatedWithBrowserContext() const {
+ return true;
+}
+
+bool SearchEnginesPrivateEventRouterFactory::ServiceIsNULLWhileTesting() const {
+ return false;
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698