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

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_consts.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..b9d5c528be9a5851146e0b7768c0505ba82db79f 100644
--- a/chrome/service/cloud_print/print_system_win.cc
+++ b/chrome/service/cloud_print/print_system_win.cc
@@ -225,33 +225,7 @@ class PrintSystemWatcherWin : public base::win::ObjectWatcher::Delegate {
bool GetCurrentPrinterInfo(printing::PrinterBasicInfo* printer_info) {
DCHECK(printer_info);
- 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;
+ return InitBasicPrinterInfo(printer_, printer_info);
}
private:
« no previous file with comments | « no previous file | printing/backend/print_backend_consts.h » ('j') | printing/backend/print_backend_consts.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698