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

Unified Diff: chrome/browser/extensions/api/debugger/debugger_api.cc

Issue 11232066: Remove GetExtensionEventRouter from Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rerebase Created 8 years, 2 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/debugger/debugger_api.cc
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
index 8c06f5ee446831b11ad9de275c0a378a3dafb63a..c987e9f70ed5ea407d794d5b7ce7f112cc1f8475 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/extensions/api/debugger/debugger_api_constants.h"
#include "chrome/browser/extensions/event_router.h"
+#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_tab_helper.h"
@@ -286,13 +287,15 @@ void ExtensionDevToolsClientHost::MarkAsDismissed() {
void ExtensionDevToolsClientHost::SendDetachedEvent() {
Profile* profile =
Profile::FromBrowserContext(web_contents_->GetBrowserContext());
- if (profile != NULL && profile->GetExtensionEventRouter()) {
+ if (profile != NULL &&
+ extensions::ExtensionSystem::Get(profile)->event_router()) {
Debuggee debuggee;
debuggee.tab_id = tab_id_;
scoped_ptr<base::ListValue> args(OnDetach::Create(debuggee,
detach_reason_));
- profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension_id_, keys::kOnDetach, args.Pass(), profile, GURL());
+ extensions::ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension_id_, keys::kOnDetach, args.Pass(),
+ profile, GURL());
}
}
@@ -321,7 +324,8 @@ void ExtensionDevToolsClientHost::DispatchOnInspectorFrontend(
const std::string& message) {
Profile* profile =
Profile::FromBrowserContext(web_contents_->GetBrowserContext());
- if (profile == NULL || !profile->GetExtensionEventRouter())
+ if (profile == NULL ||
+ !extensions::ExtensionSystem::Get(profile)->event_router())
return;
scoped_ptr<Value> result(base::JSONReader::Read(message));
@@ -344,8 +348,9 @@ void ExtensionDevToolsClientHost::DispatchOnInspectorFrontend(
params.additional_properties.Swap(params_value);
scoped_ptr<ListValue> args(OnEvent::Create(debuggee, method_name, params));
- profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension_id_, keys::kOnEvent, args.Pass(), profile, GURL());
+ extensions::ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension_id_, keys::kOnEvent, args.Pass(),
+ profile, GURL());
} else {
SendCommandDebuggerFunction* function = pending_requests_[id];
if (!function)
« no previous file with comments | « chrome/browser/extensions/api/cookies/cookies_api.cc ('k') | chrome/browser/extensions/api/downloads/downloads_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698