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

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

Issue 11641003: Renamed color_capable to color_changeable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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 | « printing/backend/print_backend.cc ('k') | no next file » | 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) 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 <objidl.h> 7 #include <objidl.h>
8 #include <winspool.h> 8 #include <winspool.h>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 PrinterInfo5 info_5; 113 PrinterInfo5 info_5;
114 if (!info_5.Init(printer_handle)) { 114 if (!info_5.Init(printer_handle)) {
115 return false; 115 return false;
116 } 116 }
117 DCHECK_EQ(info_5.get()->pPrinterName, UTF8ToUTF16(printer_name)); 117 DCHECK_EQ(info_5.get()->pPrinterName, UTF8ToUTF16(printer_name));
118 118
119 PrinterSemanticCapsAndDefaults caps; 119 PrinterSemanticCapsAndDefaults caps;
120 120
121 // Get printer capabilities. For more info see here: 121 // Get printer capabilities. For more info see here:
122 // http://msdn.microsoft.com/en-us/library/windows/desktop/dd183552(v=vs.85).a spx 122 // http://msdn.microsoft.com/en-us/library/windows/desktop/dd183552(v=vs.85).a spx
123 caps.color_capable = (::DeviceCapabilities(info_5.get()->pPrinterName, 123 caps.color_changeable = (::DeviceCapabilities(info_5.get()->pPrinterName,
124 info_5.get()->pPortName, 124 info_5.get()->pPortName,
125 DC_COLORDEVICE, 125 DC_COLORDEVICE,
126 NULL, 126 NULL,
127 NULL) == 1); 127 NULL) == 1);
128 128
129 caps.duplex_capable = (::DeviceCapabilities(info_5.get()->pPrinterName, 129 caps.duplex_capable = (::DeviceCapabilities(info_5.get()->pPrinterName,
130 info_5.get()->pPortName, 130 info_5.get()->pPortName,
131 DC_DUPLEX, 131 DC_DUPLEX,
132 NULL, 132 NULL,
133 NULL) == 1); 133 NULL) == 1);
134 134
135 UserDefaultDevMode user_settings; 135 UserDefaultDevMode user_settings;
136 136
137 if (user_settings.Init(printer_handle)) { 137 if (user_settings.Init(printer_handle)) {
(...skipping 10 matching lines...) Expand all
148 break; 148 break;
149 case DMDUP_HORIZONTAL: 149 case DMDUP_HORIZONTAL:
150 caps.duplex_default = SHORT_EDGE; 150 caps.duplex_default = SHORT_EDGE;
151 break; 151 break;
152 default: 152 default:
153 NOTREACHED(); 153 NOTREACHED();
154 } 154 }
155 } 155 }
156 } else { 156 } else {
157 LOG(WARNING) << "Fallback to color/simplex mode."; 157 LOG(WARNING) << "Fallback to color/simplex mode.";
158 caps.color_default = caps.color_capable; 158 caps.color_default = caps.color_changeable;
159 caps.duplex_default = SIMPLEX; 159 caps.duplex_default = SIMPLEX;
160 } 160 }
161 161
162 *printer_info = caps; 162 *printer_info = caps;
163 return true; 163 return true;
164 } 164 }
165 165
166 bool PrintBackendWin::GetPrinterCapsAndDefaults( 166 bool PrintBackendWin::GetPrinterCapsAndDefaults(
167 const std::string& printer_name, 167 const std::string& printer_name,
168 PrinterCapsAndDefaults* printer_info) { 168 PrinterCapsAndDefaults* printer_info) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 printer_handle.Receive(), NULL); 255 printer_handle.Receive(), NULL);
256 return printer_handle.IsValid(); 256 return printer_handle.IsValid();
257 } 257 }
258 258
259 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( 259 scoped_refptr<PrintBackend> PrintBackend::CreateInstance(
260 const base::DictionaryValue* print_backend_settings) { 260 const base::DictionaryValue* print_backend_settings) {
261 return new PrintBackendWin; 261 return new PrintBackendWin;
262 } 262 }
263 263
264 } // namespace printing 264 } // namespace printing
OLDNEW
« no previous file with comments | « printing/backend/print_backend.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698