diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-13 15:02:41 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-13 15:02:41 +0000 |
commit | d301c95c44c0b464b7a90db1eeff89d71d93165a (patch) | |
tree | 2cdb4759f0bbad43a9ce456aabda45f58baa3e99 /chrome/test | |
parent | cb691e8ff78e8bac8b155a5d76625184a06aaa72 (diff) | |
download | chromium_src-d301c95c44c0b464b7a90db1eeff89d71d93165a.zip chromium_src-d301c95c44c0b464b7a90db1eeff89d71d93165a.tar.gz chromium_src-d301c95c44c0b464b7a90db1eeff89d71d93165a.tar.bz2 |
Added an async automation message AutomationMsg_PrintAsync to asynchronously print a TabContents.
This is on the same lines as the existing sync message AutomationMsg_PrintNow
Review URL: http://codereview.chromium.org/149468
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20484 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 3 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.cc | 7 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.h | 3 |
3 files changed, 13 insertions, 0 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index 1eac286..ac1b7deb 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -973,4 +973,7 @@ IPC_BEGIN_MESSAGES(Automation) int /* request_id */, URLRequestStatus /* status */) + IPC_MESSAGE_ROUTED1(AutomationMsg_PrintAsync, + int /* tab_handle */) + IPC_END_MESSAGES(Automation) diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index dea3a54..8d8ebf7 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -532,6 +532,13 @@ bool TabProxy::PrintNow() { return succeeded; } +bool TabProxy::PrintAsync() { + if (!is_valid()) + return false; + + return sender_->Send(new AutomationMsg_PrintAsync(0, handle_)); +} + bool TabProxy::SavePage(const std::wstring& file_name, const std::wstring& dir_path, SavePackage::SavePackageType type) { diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index 0f7bcc5..200c5f9 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -250,6 +250,9 @@ class TabProxy : public AutomationResourceProxy { // Prints the current page without user intervention. bool PrintNow(); + // Sends off an asynchronous request for printing. + bool PrintAsync(); + // Save the current web page. |file_name| is the HTML file name, and // |dir_path| is the directory for saving resource files. |type| indicates // which type we're saving as: HTML only or the complete web page. |