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

Unified Diff: chrome/service/cloud_print/print_system_win.cc

Issue 9812002: Include driver infor into PrinterBasicInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months 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
« no previous file with comments | « no previous file | printing/backend/print_backend_consts.h » ('j') | printing/backend/print_backend_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/cloud_print/print_system_win.cc
diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc
index 048a3ab2f89efd4e3c0d25af4848bcf23ce2c679..453544a91dbd828a3c80974983de0fa671f41698 100644
--- a/chrome/service/cloud_print/print_system_win.cc
+++ b/chrome/service/cloud_print/print_system_win.cc
@@ -228,30 +228,17 @@ class PrintSystemWatcherWin : public base::win::ObjectWatcher::Delegate {
if (!printer_.IsValid())
return false;
- DWORD bytes_needed = 0;
- bool ret = false;
- GetPrinter(printer_, 2, NULL, 0, &bytes_needed);
- if (0 != bytes_needed) {
- scoped_array<BYTE> printer_info_buffer(new BYTE[bytes_needed]);
- if (GetPrinter(printer_, 2, printer_info_buffer.get(),
- bytes_needed, &bytes_needed)) {
- PRINTER_INFO_2* printer_info_win =
- reinterpret_cast<PRINTER_INFO_2*>(printer_info_buffer.get());
- printer_info->printer_name = WideToUTF8(printer_info_win->pPrinterName);
- if (printer_info_win->pComment)
- printer_info->printer_description =
- WideToUTF8(printer_info_win->pComment);
- if (printer_info_win->pLocation)
- printer_info->options[kLocationTagName] =
- WideToUTF8(printer_info_win->pLocation);
- if (printer_info_win->pDriverName)
- printer_info->options[kDriverNameTagName] =
- WideToUTF8(printer_info_win->pDriverName);
- printer_info->printer_status = printer_info_win->Status;
- ret = true;
- }
- }
- return ret;
+ scoped_array<BYTE> printer_info_buffer;
+ const PRINTER_INFO_2* printer_info_2 =
+ GetPrinterInfo2(printer_, &printer_info_buffer);
+ if (!printer_info_2)
+ return false;
+
+ scoped_array<BYTE> driver_info_buffer;
+ InitBasicPrinterInfo(printer_info_2,
+ GetDriverInfo6(printer_, &driver_info_buffer),
+ printer_info);
+ return true;
}
private:
« no previous file with comments | « no previous file | printing/backend/print_backend_consts.h » ('j') | printing/backend/print_backend_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698