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

Side by Side Diff: printing/backend/print_backend_cups.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "printing/backend/print_backend.h" 5 #include "printing/backend/print_backend.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <dlfcn.h> 9 #include <dlfcn.h>
10 #include <errno.h> 10 #include <errno.h>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 const char* info = cupsGetOption(kCUPSPrinterInfoOpt, 169 const char* info = cupsGetOption(kCUPSPrinterInfoOpt,
170 printer.num_options, printer.options); 170 printer.num_options, printer.options);
171 if (info != NULL) 171 if (info != NULL)
172 printer_info.printer_description = info; 172 printer_info.printer_description = info;
173 173
174 const char* state = cupsGetOption(kCUPSPrinterStateOpt, 174 const char* state = cupsGetOption(kCUPSPrinterStateOpt,
175 printer.num_options, printer.options); 175 printer.num_options, printer.options);
176 if (state != NULL) 176 if (state != NULL)
177 base::StringToInt(state, &printer_info.printer_status); 177 base::StringToInt(state, &printer_info.printer_status);
178 178
179 const char* drv_info = cupsGetOption(kCUPSPrinterMakeModelOpt,
180 printer.num_options,
181 printer.options);
182 if (drv_info)
183 printer_info.options[kDriverInfoTagName] = *drv_info;
184
179 // Store printer options. 185 // Store printer options.
180 for (int opt_index = 0; opt_index < printer.num_options; opt_index++) { 186 for (int opt_index = 0; opt_index < printer.num_options; opt_index++) {
181 printer_info.options[printer.options[opt_index].name] = 187 printer_info.options[printer.options[opt_index].name] =
182 printer.options[opt_index].value; 188 printer.options[opt_index].value;
183 } 189 }
184 190
185 printer_list->push_back(printer_info); 191 printer_list->push_back(printer_info);
186 } 192 }
187 193
188 cupsFreeDests(num_dests, destinations); 194 cupsFreeDests(num_dests, destinations);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 << ", HTTP error: " << http_error; 340 << ", HTTP error: " << http_error;
335 file_util::Delete(ppd_path, false); 341 file_util::Delete(ppd_path, false);
336 ppd_path.clear(); 342 ppd_path.clear();
337 } 343 }
338 } 344 }
339 } 345 }
340 return ppd_path; 346 return ppd_path;
341 } 347 }
342 348
343 } // namespace printing 349 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698