OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_PRINTING_PRINT_SYSTEM_TASK_PROXY_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_SYSTEM_TASK_PROXY_H_ |
6 #define CHROME_BROWSER_PRINTING_PRINT_SYSTEM_TASK_PROXY_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_SYSTEM_TASK_PROXY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // |options| will be updated if the custom settings for |printer_name| are | 30 // |options| will be updated if the custom settings for |printer_name| are |
31 // found, otherwise nothing is done. | 31 // found, otherwise nothing is done. |
32 // NOTE: This function is declared here so it can be exposed for unit testing. | 32 // NOTE: This function is declared here so it can be exposed for unit testing. |
33 void parse_lpoptions(const FilePath& filepath, const std::string& printer_name, | 33 void parse_lpoptions(const FilePath& filepath, const std::string& printer_name, |
34 int* num_options, cups_option_t** options); | 34 int* num_options, cups_option_t** options); |
35 } // namespace printing_internal | 35 } // namespace printing_internal |
36 | 36 |
37 #endif | 37 #endif |
38 | 38 |
39 class PrintSystemTaskProxy | 39 class PrintSystemTaskProxy |
40 : public base::RefCountedThreadSafe<PrintSystemTaskProxy, | 40 : public base::RefCountedThreadSafe< |
41 BrowserThread::DeleteOnUIThread> { | 41 PrintSystemTaskProxy, content::BrowserThread::DeleteOnUIThread> { |
42 public: | 42 public: |
43 PrintSystemTaskProxy(const base::WeakPtr<PrintPreviewHandler>& handler, | 43 PrintSystemTaskProxy(const base::WeakPtr<PrintPreviewHandler>& handler, |
44 printing::PrintBackend* print_backend, | 44 printing::PrintBackend* print_backend, |
45 bool has_logged_printers_count); | 45 bool has_logged_printers_count); |
46 | 46 |
47 void GetDefaultPrinter(); | 47 void GetDefaultPrinter(); |
48 | 48 |
49 void EnumeratePrinters(); | 49 void EnumeratePrinters(); |
50 | 50 |
51 void GetPrinterCapabilities(const std::string& printer_name); | 51 void GetPrinterCapabilities(const std::string& printer_name); |
52 | 52 |
53 private: | 53 private: |
54 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; | 54 friend struct content::BrowserThread::DeleteOnThread< |
| 55 content::BrowserThread::UI>; |
55 friend class DeleteTask<PrintSystemTaskProxy>; | 56 friend class DeleteTask<PrintSystemTaskProxy>; |
56 | 57 |
57 void SendDefaultPrinter(const base::StringValue* default_printer, | 58 void SendDefaultPrinter(const base::StringValue* default_printer, |
58 const base::StringValue* cloud_print_data); | 59 const base::StringValue* cloud_print_data); |
59 void SetupPrinterList(base::ListValue* printers); | 60 void SetupPrinterList(base::ListValue* printers); |
60 void SendPrinterCapabilities(base::DictionaryValue* settings_info); | 61 void SendPrinterCapabilities(base::DictionaryValue* settings_info); |
61 | 62 |
62 ~PrintSystemTaskProxy(); | 63 ~PrintSystemTaskProxy(); |
63 | 64 |
64 base::WeakPtr<PrintPreviewHandler> handler_; | 65 base::WeakPtr<PrintPreviewHandler> handler_; |
65 | 66 |
66 scoped_refptr<printing::PrintBackend> print_backend_; | 67 scoped_refptr<printing::PrintBackend> print_backend_; |
67 | 68 |
68 bool has_logged_printers_count_; | 69 bool has_logged_printers_count_; |
69 | 70 |
70 DISALLOW_COPY_AND_ASSIGN(PrintSystemTaskProxy); | 71 DISALLOW_COPY_AND_ASSIGN(PrintSystemTaskProxy); |
71 }; | 72 }; |
72 | 73 |
73 #endif // CHROME_BROWSER_PRINTING_PRINT_SYSTEM_TASK_PROXY_H_ | 74 #endif // CHROME_BROWSER_PRINTING_PRINT_SYSTEM_TASK_PROXY_H_ |
OLD | NEW |