diff options
Diffstat (limited to 'content/browser/tab_contents/tab_contents.cc')
-rw-r--r-- | content/browser/tab_contents/tab_contents.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 408eb4b..6c72691 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -366,9 +366,6 @@ void TabContents::AddObservers() { } bool TabContents::OnMessageReceived(const IPC::Message& message) { - if (web_ui() && web_ui()->OnMessageReceived(message)) - return true; - ObserverListBase<TabContentsObserver>::Iterator it(observers_); TabContentsObserver* observer; while ((observer = it.GetNext()) != NULL) @@ -2010,6 +2007,19 @@ void TabContents::DomOperationResponse(const std::string& json_string, int automation_id) { } +void TabContents::ProcessWebUIMessage( + const ExtensionHostMsg_DomMessage_Params& params) { + if (!render_manager_.web_ui()) { + // This can happen if someone uses window.open() to open an extension URL + // from a non-extension context. + render_view_host()->Send(new ExtensionMsg_Response( + render_view_host()->routing_id(), params.request_id, false, "", + "Access to extension API denied.")); + return; + } + render_manager_.web_ui()->ProcessWebUIMessage(params); +} + void TabContents::ProcessExternalHostMessage(const std::string& message, const std::string& origin, const std::string& target) { |