From 7120f1327bcd3f0c33a983ee4a61c277747bb566 Mon Sep 17 00:00:00 2001 From: "mpcomplete@chromium.org" Date: Mon, 20 Jul 2009 21:05:37 +0000 Subject: Changed the extension.connect() API not to broadcast to all tabs. Added a more specific tabs.connect(tabId) API to connect to a specific tab. Also changed the ExtensionMessageService from a singleton to a Profile-owned object. BUG=12461 TEST=no Review URL: http://codereview.chromium.org/155707 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21102 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/render_view.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'chrome/renderer/render_view.cc') diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index a7445c0..0052e1e 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -38,6 +38,7 @@ #include "chrome/renderer/devtools_client.h" #include "chrome/renderer/extensions/event_bindings.h" #include "chrome/renderer/extensions/extension_process_bindings.h" +#include "chrome/renderer/extensions/renderer_extension_bindings.h" #include "chrome/renderer/localized_error.h" #include "chrome/renderer/media/audio_renderer_impl.h" #include "chrome/renderer/media/buffered_data_source.h" @@ -415,6 +416,8 @@ void RenderView::OnMessageReceived(const IPC::Message& message) { OnPopupNotificationVisibilityChanged) IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) IPC_MESSAGE_HANDLER(ViewMsg_ExtensionResponse, OnExtensionResponse) + IPC_MESSAGE_HANDLER(ViewMsg_ExtensionMessageInvoke, + OnExtensionMessageInvoke) IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedNode, OnClearFocusedNode) IPC_MESSAGE_HANDLER(ViewMsg_SetBackground, OnSetBackground) IPC_MESSAGE_HANDLER(ViewMsg_EnableIntrinsicWidthChangedMode, @@ -1471,7 +1474,7 @@ void RenderView::DocumentElementAvailable(WebFrame* frame) { } void RenderView::DidCreateScriptContextForFrame(WebFrame* webframe) { - EventBindings::HandleContextCreated(webframe); + EventBindings::HandleContextCreated(webframe, false); } void RenderView::DidDestroyScriptContextForFrame(WebFrame* webframe) { @@ -1479,7 +1482,7 @@ void RenderView::DidDestroyScriptContextForFrame(WebFrame* webframe) { } void RenderView::DidCreateIsolatedScriptContext(WebFrame* webframe) { - EventBindings::HandleContextCreated(webframe); + EventBindings::HandleContextCreated(webframe, true); } WebNavigationPolicy RenderView::PolicyForNavigationAction( @@ -2855,6 +2858,11 @@ void RenderView::OnExtensionResponse(int request_id, request_id, success, response, error); } +void RenderView::OnExtensionMessageInvoke(const std::string& function_name, + const ListValue& args) { + RendererExtensionBindings::Invoke(function_name, args, this); +} + // Dump all load time histograms. // // There are 13 histograms measuring various times. -- cgit v1.1