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

Unified Diff: chrome/browser/ui/panels/panel_host.cc

Issue 1169223002: [Extensions] Clean up the handling of ExtensionHostMsg_Request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 6 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/ui/panels/panel_host.cc
diff --git a/chrome/browser/ui/panels/panel_host.cc b/chrome/browser/ui/panels/panel_host.cc
index 8c70a68f2b0906aa71b6b614eb05c126c9f80092..a334dbd11286889cfb95f9114b61e115e170429e 100644
--- a/chrome/browser/ui/panels/panel_host.cc
+++ b/chrome/browser/ui/panels/panel_host.cc
@@ -40,7 +40,6 @@ using base::UserMetricsAction;
PanelHost::PanelHost(Panel* panel, Profile* profile)
: panel_(panel),
profile_(profile),
- extension_function_dispatcher_(profile, this),
weak_factory_(this) {
}
@@ -71,6 +70,8 @@ void PanelHost::Init(const GURL& url) {
PrefsTabHelper::CreateForWebContents(web_contents_.get());
extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
web_contents_.get());
+ extensions::ExtensionWebContentsObserver::GetForWebContents(
+ web_contents_.get())->dispatcher()->set_delegate(this);
web_contents_->GetController().LoadURL(
url, content::Referrer(), ui::PAGE_TRANSITION_LINK, std::string());
@@ -225,23 +226,6 @@ void PanelHost::ClosePanel() {
panel_->Close();
}
-bool PanelHost::OnMessageReceived(const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(PanelHost, message)
- IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void PanelHost::OnRequest(const ExtensionHostMsg_Request_Params& params) {
- if (!web_contents_.get())
- return;
-
- extension_function_dispatcher_.Dispatch(params,
- web_contents_->GetRenderViewHost());
-}
-
extensions::WindowController* PanelHost::GetExtensionWindowController() const {
return panel_->extension_window_controller();
}

Powered by Google App Engine
This is Rietveld 408576698