diff options
-rw-r--r-- | chrome/browser/external_tab_container.cc | 4 | ||||
-rw-r--r-- | chrome/browser/external_tab_container.h | 3 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 3 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.h | 3 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host_delegate.h | 3 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_delegate.h | 3 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents.cc | 5 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents.h | 3 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 7 | ||||
-rw-r--r-- | chrome/renderer/external_host_bindings.cc | 12 | ||||
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 5 |
11 files changed, 17 insertions, 34 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index 77bb72a..216d171 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -252,10 +252,10 @@ void ExternalTabContainer::ToolbarSizeChanged(TabContents* source, } void ExternalTabContainer::ForwardMessageToExternalHost( - const std::string& receiver, const std::string& message) { + const std::string& message) { if(automation_) { automation_->Send( - new AutomationMsg_ForwardMessageToExternalHost(0, receiver, message)); + new AutomationMsg_ForwardMessageToExternalHost(0, message)); } } diff --git a/chrome/browser/external_tab_container.h b/chrome/browser/external_tab_container.h index f82c40f..f786606 100644 --- a/chrome/browser/external_tab_container.h +++ b/chrome/browser/external_tab_container.h @@ -79,8 +79,7 @@ class ExternalTabContainer : public TabContentsDelegate, virtual void UpdateTargetURL(TabContents* source, const GURL& url); virtual void ContentsZoomChange(bool zoom_in); virtual void ToolbarSizeChanged(TabContents* source, bool is_animating); - virtual void ForwardMessageToExternalHost(const std::string& receiver, - const std::string& message); + virtual void ForwardMessageToExternalHost(const std::string& message); virtual bool IsExternalTabContainer() const { return true; }; diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 28117c2..0af9211 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -1036,9 +1036,8 @@ void RenderViewHost::OnMsgDOMUISend( } void RenderViewHost::OnMsgForwardMessageToExternalHost( - const std::string& receiver, const std::string& message) { - delegate_->ProcessExternalHostMessage(receiver, message); + delegate_->ProcessExternalHostMessage(message); } #ifdef CHROME_PERSONALIZATION diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 39704f3..daf6044 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -475,8 +475,7 @@ class RenderViewHost : public RenderWidgetHost { int automation_id); void OnMsgDOMUISend(const std::string& message, const std::string& content); - void OnMsgForwardMessageToExternalHost(const std::string& receiver, - const std::string& message); + void OnMsgForwardMessageToExternalHost(const std::string& message); #ifdef CHROME_PERSONALIZATION void OnPersonalizationEvent(const std::string& message, const std::string& content); diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index 7c7fe4a..5a70c78 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -252,8 +252,7 @@ class RenderViewHostDelegate { // A message for external host. By default we ignore such messages. // |receiver| can be a receiving script and |message| is any // arbitrary string that makes sense to the receiver. - virtual void ProcessExternalHostMessage(const std::string& receiver, - const std::string& message) { } + virtual void ProcessExternalHostMessage(const std::string& message) { } // Navigate to the history entry for the given offset from the current // position within the NavigationController. Makes no change if offset is diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h index 05f5e79..6a76c15 100644 --- a/chrome/browser/tab_contents/tab_contents_delegate.h +++ b/chrome/browser/tab_contents/tab_contents_delegate.h @@ -137,8 +137,7 @@ class TabContentsDelegate : public PageNavigator { } // Send IPC to external host. Default implementation is do nothing. - virtual void ForwardMessageToExternalHost(const std::string& receiver, - const std::string& message) {} + virtual void ForwardMessageToExternalHost(const std::string& message) {} // If the delegate is hosting tabs externally. virtual bool IsExternalTabContainer() const { return false; } diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc index 11665cc..449a51e 100644 --- a/chrome/browser/tab_contents/web_contents.cc +++ b/chrome/browser/tab_contents/web_contents.cc @@ -1007,10 +1007,9 @@ void WebContents::DomOperationResponse(const std::string& json_string, Details<DomOperationNotificationDetails>(&details)); } -void WebContents::ProcessExternalHostMessage(const std::string& receiver, - const std::string& message) { +void WebContents::ProcessExternalHostMessage(const std::string& message) { if (delegate()) - delegate()->ForwardMessageToExternalHost(receiver, message); + delegate()->ForwardMessageToExternalHost(message); } void WebContents::GoToEntryAtOffset(int offset) { diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h index 9ed4331..110e923 100644 --- a/chrome/browser/tab_contents/web_contents.h +++ b/chrome/browser/tab_contents/web_contents.h @@ -334,8 +334,7 @@ class WebContents : public TabContents, WindowOpenDisposition disposition); virtual void DomOperationResponse(const std::string& json_string, int automation_id); - virtual void ProcessExternalHostMessage(const std::string& receiver, - const std::string& message); + virtual void ProcessExternalHostMessage(const std::string& message); virtual void GoToEntryAtOffset(int offset); virtual void GetHistoryListCount(int* back_list_count, int* forward_list_count); diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 6d75d81..5558ca1 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -827,12 +827,7 @@ IPC_BEGIN_MESSAGES(ViewHost) std::string /* args (as a JSON string) */) // A message for an external host. - // |receiver| can be a receiving script and |message| is any - // arbitrary string that makes sense to the receiver. For - // example, a user of automation can use it to execute a script - // in the form of javascript:receiver("message"); - IPC_MESSAGE_ROUTED2(ViewHostMsg_ForwardMessageToExternalHost, - std::string /* receiver */, + IPC_MESSAGE_ROUTED1(ViewHostMsg_ForwardMessageToExternalHost, std::string /* message */) #ifdef CHROME_PERSONALIZATION diff --git a/chrome/renderer/external_host_bindings.cc b/chrome/renderer/external_host_bindings.cc index 4808a30..0f0ad92 100644 --- a/chrome/renderer/external_host_bindings.cc +++ b/chrome/renderer/external_host_bindings.cc @@ -14,19 +14,17 @@ void ExternalHostBindings::BindMethods() { void ExternalHostBindings::ForwardMessageToExternalHost( const CppArgumentList& args, CppVariant* result) { - // We expect at least a string message identifier, and optionally take - // an object parameter. If we get anything else we bail. - if (args.size() < 2) + // We only accept a string message identifier. + if (args.size() != 1) return; // Args should be strings. - if (!args[0].isString() && !args[1].isString()) + if (!args[0].isString()) return; - const std::string& receiver = args[0].ToString(); - const std::string& message = args[1].ToString(); + const std::string& message = args[0].ToString(); sender()->Send(new ViewHostMsg_ForwardMessageToExternalHost( - routing_id(), receiver, message)); + routing_id(), message)); } diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index 48dfe3d..be37ce8 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -729,10 +729,7 @@ IPC_BEGIN_MESSAGES(Automation) std::string /* message */ ) // A message for an external host. - // |receiver| can be a receiving script and |message| is any - // arbitrary string that makes sense to the receiver. - IPC_MESSAGE_ROUTED2(AutomationMsg_ForwardMessageToExternalHost, - std::string /* receiver*/, + IPC_MESSAGE_ROUTED1(AutomationMsg_ForwardMessageToExternalHost, std::string /* message*/) // This message starts a find within a tab corresponding to the supplied |