summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/automation_provider.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/automation/automation_provider.cc')
-rw-r--r--chrome/browser/automation/automation_provider.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 2cd8377..5636302 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -698,6 +698,8 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(AutomationMsg_IsWindowActiveRequest, IsWindowActive)
IPC_MESSAGE_HANDLER(AutomationMsg_ActivateWindow, ActivateWindow);
IPC_MESSAGE_HANDLER(AutomationMsg_WindowHWNDRequest, GetWindowHWND)
+ IPC_MESSAGE_HANDLER(AutomationMsg_WindowExecuteCommandRequest,
+ ExecuteBrowserCommand)
IPC_MESSAGE_HANDLER(AutomationMsg_WindowViewBoundsRequest,
WindowGetViewBounds)
IPC_MESSAGE_HANDLER(AutomationMsg_SetWindowVisibleRequest, SetWindowVisible)
@@ -1091,6 +1093,23 @@ void AutomationProvider::GetWindowHWND(const IPC::Message& message,
win32_handle));
}
+void AutomationProvider::ExecuteBrowserCommand(const IPC::Message& message,
+ int handle,
+ int command) {
+
+ bool success = false;
+ if (browser_tracker_->ContainsHandle(handle)) {
+ Browser* browser = browser_tracker_->GetResource(handle);
+ if (browser->SupportsCommand(command) &&
+ browser->IsCommandEnabled(command)) {
+ browser->ExecuteCommand(command);
+ success = true;
+ }
+ }
+ Send(new AutomationMsg_WindowExecuteCommandResponse(message.routing_id(),
+ success));
+}
+
void AutomationProvider::WindowGetViewBounds(const IPC::Message& message,
int handle,
int view_id,