OLD | NEW |
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 // This is dummy implementation for all configurations where there is no | 5 // This is dummy implementation for all configurations where there is no |
6 // print backend. | 6 // print backend. |
7 #if !defined(PRINT_BACKEND_AVAILABLE) | 7 #if !defined(PRINT_BACKEND_AVAILABLE) |
8 | 8 |
9 #include "printing/backend/print_backend.h" | 9 #include "printing/backend/print_backend.h" |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 | 13 |
14 namespace printing { | 14 namespace printing { |
15 | 15 |
| 16 class DummyPrintBackend : public PrintBackend { |
| 17 public: |
| 18 DummyPrintBackend() { |
| 19 } |
| 20 |
| 21 bool EnumeratePrinters(PrinterList* printer_list) override { |
| 22 return false; |
| 23 } |
| 24 |
| 25 std::string GetDefaultPrinterName() override { |
| 26 return std::string(); |
| 27 } |
| 28 |
| 29 bool GetPrinterSemanticCapsAndDefaults( |
| 30 const std::string& printer_name, |
| 31 PrinterSemanticCapsAndDefaults* printer_info) override { |
| 32 return false; |
| 33 } |
| 34 |
| 35 bool GetPrinterCapsAndDefaults( |
| 36 const std::string& printer_name, |
| 37 PrinterCapsAndDefaults* printer_info) override { |
| 38 return false; |
| 39 } |
| 40 |
| 41 std::string GetPrinterDriverInfo( |
| 42 const std::string& printer_name) override { |
| 43 return std::string(); |
| 44 } |
| 45 |
| 46 bool IsValidPrinter(const std::string& printer_name) override { |
| 47 return false; |
| 48 } |
| 49 |
| 50 private: |
| 51 ~DummyPrintBackend() {} |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(DummyPrintBackend); |
| 54 }; |
| 55 |
16 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( | 56 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( |
17 const base::DictionaryValue* print_backend_settings) { | 57 const base::DictionaryValue* print_backend_settings) { |
18 NOTREACHED(); | 58 return new DummyPrintBackend(); |
19 return NULL; | |
20 } | 59 } |
21 | 60 |
22 } // namespace printing | 61 } // namespace printing |
23 | 62 |
24 #endif // PRINT_BACKEND_AVAILABLE | 63 #endif // PRINT_BACKEND_AVAILABLE |
OLD | NEW |