summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 15:02:41 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 15:02:41 +0000
commitd301c95c44c0b464b7a90db1eeff89d71d93165a (patch)
tree2cdb4759f0bbad43a9ce456aabda45f58baa3e99 /chrome/browser
parentcb691e8ff78e8bac8b155a5d76625184a06aaa72 (diff)
downloadchromium_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/browser')
-rw-r--r--chrome/browser/automation/automation_provider.cc10
-rw-r--r--chrome/browser/automation/automation_provider.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index f386960..49bd64f 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -1020,6 +1020,7 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(AutomationMsg_IsPageMenuCommandEnabled,
IsPageMenuCommandEnabled)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_PrintNow, PrintNow)
+ IPC_MESSAGE_HANDLER(AutomationMsg_PrintAsync, PrintAsync)
IPC_MESSAGE_HANDLER(AutomationMsg_SavePage, SavePage)
IPC_MESSAGE_HANDLER(AutomationMsg_AutocompleteEditGetText,
GetAutocompleteEditText)
@@ -2577,6 +2578,15 @@ void AutomationProvider::PrintNow(int tab_handle,
AutomationMsg_PrintNow::WriteReplyParams(reply_message, false);
Send(reply_message);
}
+
+void AutomationProvider::PrintAsync(int tab_handle) {
+ NavigationController* tab = NULL;
+ TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab);
+ if (tab_contents) {
+ if (tab_contents->PrintNow())
+ return;
+ }
+}
#endif
void AutomationProvider::SavePage(int tab_handle,
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 3d90d04..8c57e7a 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -357,6 +357,9 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
// Prints the current tab immediately.
void PrintNow(int tab_handle, IPC::Message* reply_message);
+ // Asynchronous request for printing the current tab.
+ void PrintAsync(int tab_handle);
+
// Save the current web page.
void SavePage(int tab_handle,
const std::wstring& file_name,