diff options
author | jcampan@google.com <jcampan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-04 23:28:47 +0000 |
---|---|---|
committer | jcampan@google.com <jcampan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-04 23:28:47 +0000 |
commit | 4ae627586ecb6184c3b766fd5128709442b17360 (patch) | |
tree | 44726dd64ec639e8545b189c52f9bb6de1ecb818 /chrome/browser/automation | |
parent | 41c2cd46aecd34eb258ed92b242ee86c333f06a8 (diff) | |
download | chromium_src-4ae627586ecb6184c3b766fd5128709442b17360.zip chromium_src-4ae627586ecb6184c3b766fd5128709442b17360.tar.gz chromium_src-4ae627586ecb6184c3b766fd5128709442b17360.tar.bz2 |
Another attempt at this CL.
I had to revert because it was somehow causing regressions on the page cycler and start-up tests.
(I suspect because I did add an IPC message not at the end of the message list)
TBR=beng
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@351 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 19 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider.h | 3 |
2 files changed, 22 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, diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 249bc7e..85171d3 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -134,6 +134,9 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, void GetLastActiveBrowserWindow(const IPC::Message& message); void GetActiveWindow(const IPC::Message& message); void GetWindowHWND(const IPC::Message& message, int handle); + void ExecuteBrowserCommand(const IPC::Message& message, + int handle, + int command); void WindowGetViewBounds(const IPC::Message& message, int handle, int view_id, |