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

Side by Side Diff: printing/backend/print_backend_win.cc

Issue 6037019: Fixed a crash with some HP printer drivers (when invoking PTGetPrintCapabilit... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
« no previous file with comments | « chrome/service/cloud_print/print_system_win.cc ('k') | printing/backend/win_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <objidl.h> 7 #include <objidl.h>
8 #include <winspool.h> 8 #include <winspool.h>
9 9
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 info.options[kDriverNameTagName] = 78 info.options[kDriverNameTagName] =
79 WideToUTF8(printer_info[index].pDriverName); 79 WideToUTF8(printer_info[index].pDriverName);
80 printer_list->push_back(info); 80 printer_list->push_back(info);
81 } 81 }
82 } 82 }
83 } 83 }
84 84
85 bool PrintBackendWin::GetPrinterCapsAndDefaults( 85 bool PrintBackendWin::GetPrinterCapsAndDefaults(
86 const std::string& printer_name, 86 const std::string& printer_name,
87 PrinterCapsAndDefaults* printer_info) { 87 PrinterCapsAndDefaults* printer_info) {
88 if (!XPSModule::Init()) { 88 ScopedXPSInitializer xps_initializer;
89 if (!xps_initializer.initialized()) {
89 // TODO(sanjeevr): Handle legacy proxy case (with no prntvpt.dll) 90 // TODO(sanjeevr): Handle legacy proxy case (with no prntvpt.dll)
90 return false; 91 return false;
91 } 92 }
92 if (!IsValidPrinter(printer_name)) { 93 if (!IsValidPrinter(printer_name)) {
93 return false; 94 return false;
94 } 95 }
95 DCHECK(printer_info); 96 DCHECK(printer_info);
96 HPTPROVIDER provider = NULL; 97 HPTPROVIDER provider = NULL;
97 std::wstring printer_name_wide = UTF8ToWide(printer_name); 98 std::wstring printer_name_wide = UTF8ToWide(printer_name);
98 HRESULT hr = XPSModule::OpenProvider(printer_name_wide, 1, &provider); 99 HRESULT hr = XPSModule::OpenProvider(printer_name_wide, 1, &provider);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 171 }
171 return ret; 172 return ret;
172 } 173 }
173 174
174 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( 175 scoped_refptr<PrintBackend> PrintBackend::CreateInstance(
175 const DictionaryValue* print_backend_settings) { 176 const DictionaryValue* print_backend_settings) {
176 return new PrintBackendWin; 177 return new PrintBackendWin;
177 } 178 }
178 179
179 } // namespace printing 180 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/service/cloud_print/print_system_win.cc ('k') | printing/backend/win_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698