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

Unified Diff: chrome/browser/notifications/balloon_host.cc

Issue 6794035: Move dispatching and sending of the last extension specific messages out of TabContents and Rende... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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/notifications/balloon_host.cc
===================================================================
--- chrome/browser/notifications/balloon_host.cc (revision 80315)
+++ chrome/browser/notifications/balloon_host.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/notifications/balloon_host.h"
#include "chrome/browser/browser_list.h"
+#include "chrome/browser/extensions/extension_message_handler.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/notifications/balloon.h"
@@ -70,6 +71,12 @@
return balloon_->notification().display_source();
}
+bool BalloonHost::OnMessageReceived(const IPC::Message& message) {
+ if (!extension_message_handler_.get())
+ return false;
+ return extension_message_handler_->OnMessageReceived(message);
+}
+
WebPreferences BalloonHost::GetWebkitPrefs() {
WebPreferences web_prefs =
RenderViewHostDelegateHelper::GetWebkitPrefs(GetProfile(),
@@ -132,13 +139,6 @@
return this;
}
-void BalloonHost::ProcessWebUIMessage(
- const ExtensionHostMsg_DomMessage_Params& params) {
- if (extension_function_dispatcher_.get()) {
- extension_function_dispatcher_->HandleRequest(params);
- }
-}
-
// RenderViewHostDelegate::View methods implemented to allow links to
// open pages in new tabs.
void BalloonHost::CreateNewWindow(
@@ -209,6 +209,11 @@
balloon_->notification().content_url());
static_cast<BrowserRenderProcessHost*>(rvh->process())->set_installed_app(
installed_app);
+
+ extension_message_handler_.reset(new ExtensionMessageHandler(
+ rvh->process()->id(), rvh, GetProfile()));
+ extension_message_handler_->set_extension_function_dispatcher(
+ extension_function_dispatcher_.get());
} else if (enable_web_ui_) {
rvh->AllowBindings(BindingsPolicy::WEB_UI);
}

Powered by Google App Engine
This is Rietveld 408576698