Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2013)

Unified Diff: chrome/utility/utility_thread.cc

Issue 5947002: As the first step in an effort to improve robustness of the cloud print proxy... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixed Mac/Linux compile error Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/utility/utility_thread.cc
===================================================================
--- chrome/utility/utility_thread.cc (revision 69496)
+++ chrome/utility/utility_thread.cc (working copy)
@@ -63,6 +63,8 @@
OnIDBKeysFromValuesAndKeyPath)
IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Started, OnBatchModeStarted)
IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Finished, OnBatchModeFinished)
+ IPC_MESSAGE_HANDLER(UtilityMsg_GetPrinterCapsAndDefaults,
+ OnGetPrinterCapsAndDefaults)
IPC_END_MESSAGE_MAP()
}
@@ -306,7 +308,22 @@
ChildProcess::current()->ReleaseProcess();
}
+void UtilityThread::OnGetPrinterCapsAndDefaults(
+ const std::string& printer_name) {
+ scoped_refptr<printing::PrintBackend> print_backend =
+ printing::PrintBackend::CreateInstance(NULL);
+ printing::PrinterCapsAndDefaults printer_info;
+ if (print_backend->GetPrinterCapsAndDefaults(printer_name, &printer_info)) {
+ Send(new UtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded(printer_name,
+ printer_info));
+ } else {
+ Send(new UtilityHostMsg_GetPrinterCapsAndDefaults_Failed(printer_name));
+ }
+ ReleaseProcessIfNeeded();
+}
+
void UtilityThread::ReleaseProcessIfNeeded() {
if (!batch_mode_)
ChildProcess::current()->ReleaseProcess();
}
+
« chrome/service/service_utility_process_host.cc ('K') | « chrome/utility/utility_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698