diff options
Diffstat (limited to 'chrome/browser/automation/automation_provider_win.cc')
-rw-r--r-- | chrome/browser/automation/automation_provider_win.cc | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index 6cc06d9..9d41e50 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -8,14 +8,10 @@ #include "base/json/json_reader.h" #include "base/utf_string_conversions.h" #include "chrome/browser/automation/automation_browser_tracker.h" -#include "chrome/browser/automation/automation_extension_function.h" #include "chrome/browser/automation/automation_tab_tracker.h" #include "chrome/browser/automation/automation_window_tracker.h" -#include "chrome/browser/automation/extension_automation_constants.h" -#include "chrome/browser/automation/extension_port_container.h" #include "chrome/browser/automation/ui_controls.h" #include "chrome/browser/browser_window.h" -#include "chrome/browser/extensions/extension_event_router.h" #include "chrome/browser/external_tab_container_win.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" @@ -405,21 +401,6 @@ void AutomationProvider::ConnectExternalTab( TRACE_EVENT_END("AutomationProvider::ConnectExternalTab", 0, ""); } -void AutomationProvider::SetEnableExtensionAutomation( - int tab_handle, - const std::vector<std::string>& functions_enabled) { - ExternalTabContainer* external_tab = GetExternalTabForHandle(tab_handle); - if (external_tab) { - external_tab->SetEnableExtensionAutomation(functions_enabled); - } else { - // Tab must exist, and must be an external tab so that its - // delegate has an on-empty - // implementation of ForwardMessageToExternalHost. - DLOG(WARNING) << - "SetEnableExtensionAutomation called with invalid tab handle."; - } -} - void AutomationProvider::OnBrowserMoved(int tab_handle) { ExternalTabContainer* external_tab = GetExternalTabForHandle(tab_handle); if (external_tab) { @@ -438,69 +419,9 @@ void AutomationProvider::OnMessageFromExternalHost(int handle, if (!view_host) return; - if (AutomationExtensionFunction::InterceptMessageFromExternalHost( - view_host, message, origin, target)) { - // Message was diverted. - return; - } - - if (ExtensionPortContainer::InterceptMessageFromExternalHost( - message, origin, target, this, view_host, handle)) { - // Message was diverted. - return; - } - - if (InterceptBrowserEventMessageFromExternalHost(message, origin, target)) { - // Message was diverted. - return; - } - view_host->ForwardMessageFromExternalHost(message, origin, target); } -bool AutomationProvider::InterceptBrowserEventMessageFromExternalHost( - const std::string& message, const std::string& origin, - const std::string& target) { - if (target != - extension_automation_constants::kAutomationBrowserEventRequestTarget) - return false; - - if (origin != extension_automation_constants::kAutomationOrigin) { - LOG(WARNING) << "Wrong origin on automation browser event " << origin; - return false; - } - - // The message is a JSON-encoded array with two elements, both strings. The - // first is the name of the event to dispatch. The second is a JSON-encoding - // of the arguments specific to that event. - scoped_ptr<Value> message_value(base::JSONReader::Read(message, false)); - if (!message_value.get() || !message_value->IsType(Value::TYPE_LIST)) { - LOG(WARNING) << "Invalid browser event specified through automation"; - return false; - } - - const ListValue* args = static_cast<const ListValue*>(message_value.get()); - - std::string event_name; - if (!args->GetString(0, &event_name)) { - LOG(WARNING) << "No browser event name specified through automation"; - return false; - } - - std::string json_args; - if (!args->GetString(1, &json_args)) { - LOG(WARNING) << "No browser event args specified through automation"; - return false; - } - - if (profile()->GetExtensionEventRouter()) { - profile()->GetExtensionEventRouter()->DispatchEventToRenderers( - event_name, json_args, profile(), GURL()); - } - - return true; -} - void AutomationProvider::NavigateInExternalTab( int handle, const GURL& url, const GURL& referrer, AutomationMsg_NavigationResponseValues* status) { |