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/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 bool succeeded, | 538 bool succeeded, |
539 const std::string& printer_name, | 539 const std::string& printer_name, |
540 const printing::PrinterSemanticCapsAndDefaults& semantic_info) override { | 540 const printing::PrinterSemanticCapsAndDefaults& semantic_info) override { |
541 printing::PrinterCapsAndDefaults printer_info; | 541 printing::PrinterCapsAndDefaults printer_info; |
542 if (succeeded) { | 542 if (succeeded) { |
543 printer_info.caps_mime_type = kContentTypeJSON; | 543 printer_info.caps_mime_type = kContentTypeJSON; |
544 scoped_ptr<base::DictionaryValue> description( | 544 scoped_ptr<base::DictionaryValue> description( |
545 PrinterSemanticCapsAndDefaultsToCdd(semantic_info)); | 545 PrinterSemanticCapsAndDefaultsToCdd(semantic_info)); |
546 if (description) { | 546 if (description) { |
547 base::JSONWriter::WriteWithOptions( | 547 base::JSONWriter::WriteWithOptions( |
548 description.get(), base::JSONWriter::OPTIONS_PRETTY_PRINT, | 548 *description, base::JSONWriter::OPTIONS_PRETTY_PRINT, |
549 &printer_info.printer_capabilities); | 549 &printer_info.printer_capabilities); |
550 } | 550 } |
551 } | 551 } |
552 callback_.Run(succeeded, printer_name, printer_info); | 552 callback_.Run(succeeded, printer_name, printer_info); |
553 callback_.Reset(); | 553 callback_.Reset(); |
554 Release(); | 554 Release(); |
555 } | 555 } |
556 | 556 |
557 void StartGetPrinterCapsAndDefaults() { | 557 void StartGetPrinterCapsAndDefaults() { |
558 g_service_process->io_thread()->message_loop_proxy()->PostTask( | 558 g_service_process->io_thread()->message_loop_proxy()->PostTask( |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 } | 820 } |
821 | 821 |
822 } // namespace | 822 } // namespace |
823 | 823 |
824 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 824 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
825 const base::DictionaryValue* print_system_settings) { | 825 const base::DictionaryValue* print_system_settings) { |
826 return new PrintSystemWin; | 826 return new PrintSystemWin; |
827 } | 827 } |
828 | 828 |
829 } // namespace cloud_print | 829 } // namespace cloud_print |
OLD | NEW |