diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 10 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider.h | 3 |
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, |