OLD | NEW |
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 "chrome/service/cloud_print/print_system.h" | 5 #include "chrome/service/cloud_print/print_system.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 JobSpooler::Delegate* delegate) { | 263 JobSpooler::Delegate* delegate) { |
264 if (delegate_) { | 264 if (delegate_) { |
265 // We are already in the process of printing. | 265 // We are already in the process of printing. |
266 NOTREACHED(); | 266 NOTREACHED(); |
267 return false; | 267 return false; |
268 } | 268 } |
269 base::string16 printer_wide = base::UTF8ToWide(printer_name); | 269 base::string16 printer_wide = base::UTF8ToWide(printer_name); |
270 last_page_printed_ = -1; | 270 last_page_printed_ = -1; |
271 // We only support PDF and XPS documents for now. | 271 // We only support PDF and XPS documents for now. |
272 if (print_data_mime_type == kContentTypePDF) { | 272 if (print_data_mime_type == kContentTypePDF) { |
273 scoped_ptr<DEVMODE[]> dev_mode; | 273 scoped_ptr<DEVMODE, base::FreeDeleter> dev_mode; |
274 if (print_ticket_mime_type == kContentTypeJSON) { | 274 if (print_ticket_mime_type == kContentTypeJSON) { |
275 dev_mode = CjtToDevMode(printer_wide, print_ticket); | 275 dev_mode = CjtToDevMode(printer_wide, print_ticket); |
276 } else { | 276 } else { |
277 DCHECK(print_ticket_mime_type == kContentTypeXML); | 277 DCHECK(print_ticket_mime_type == kContentTypeXML); |
278 dev_mode = printing::XpsTicketToDevMode(printer_wide, print_ticket); | 278 dev_mode = printing::XpsTicketToDevMode(printer_wide, print_ticket); |
279 } | 279 } |
280 | 280 |
281 if (!dev_mode) { | 281 if (!dev_mode) { |
282 NOTREACHED(); | 282 NOTREACHED(); |
283 return false; | 283 return false; |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 } | 834 } |
835 | 835 |
836 } // namespace | 836 } // namespace |
837 | 837 |
838 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 838 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
839 const base::DictionaryValue* print_system_settings) { | 839 const base::DictionaryValue* print_system_settings) { |
840 return new PrintSystemWin; | 840 return new PrintSystemWin; |
841 } | 841 } |
842 | 842 |
843 } // namespace cloud_print | 843 } // namespace cloud_print |
OLD | NEW |