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_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
| 10 |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
11 #include "chrome/browser/ui/shell_dialogs.h" | 13 #include "chrome/browser/ui/shell_dialogs.h" |
12 #include "content/browser/webui/web_ui.h" | 14 #include "content/browser/webui/web_ui.h" |
13 | 15 |
14 class FilePath; | 16 class FilePath; |
15 class FundamentalValue; | 17 class FundamentalValue; |
16 class PrintSystemTaskProxy; | 18 class PrintSystemTaskProxy; |
17 class StringValue; | 19 class StringValue; |
18 | 20 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void HandlePrint(const ListValue* args); | 59 void HandlePrint(const ListValue* args); |
58 | 60 |
59 // Get the printer capabilities. | 61 // Get the printer capabilities. |
60 // First element of |args| is the printer name. | 62 // First element of |args| is the printer name. |
61 void HandleGetPrinterCapabilities(const ListValue* args); | 63 void HandleGetPrinterCapabilities(const ListValue* args); |
62 | 64 |
63 // Ask the initiator renderer to show the native print system dialog. | 65 // Ask the initiator renderer to show the native print system dialog. |
64 // |args| is unused. | 66 // |args| is unused. |
65 void HandleShowSystemDialog(const ListValue* args); | 67 void HandleShowSystemDialog(const ListValue* args); |
66 | 68 |
| 69 // Bring up a web page to allow the user to configure cloud print. |
| 70 // |args| is unused. |
| 71 void HandleManageCloudPrint(const ListValue* args); |
| 72 |
67 // Ask the browser to show the native printer management dialog. | 73 // Ask the browser to show the native printer management dialog. |
68 // |args| is unused. | 74 // |args| is unused. |
69 void HandleManagePrinters(const ListValue* args); | 75 void HandleManagePrinters(const ListValue* args); |
70 | 76 |
71 // Ask the browser to close the preview tab. | 77 // Ask the browser to close the preview tab. |
72 // |args| is unused. | 78 // |args| is unused. |
73 void HandleClosePreviewTab(const ListValue* args); | 79 void HandleClosePreviewTab(const ListValue* args); |
74 | 80 |
75 // Send the printer capabilities to the Web UI. | 81 // Send the printer capabilities to the Web UI. |
76 // |settings_info| contains printer capabilities information. | 82 // |settings_info| contains printer capabilities information. |
77 void SendPrinterCapabilities(const DictionaryValue& settings_info); | 83 void SendPrinterCapabilities(const DictionaryValue& settings_info); |
78 | 84 |
79 // Send the default printer to the Web UI. | 85 // Send the default printer to the Web UI. |
80 void SendDefaultPrinter(const StringValue& default_printer); | 86 void SendDefaultPrinter(const StringValue& default_printer); |
81 | 87 |
82 // Send the list of printers to the Web UI. | 88 // Send the list of printers to the Web UI. |
83 void SendPrinterList(const ListValue& printers); | 89 void SetupPrinterList(const ListValue& printers); |
| 90 |
| 91 // Send whether cloud print integration should be enabled. |
| 92 void SendCloudPrintEnabled(); |
| 93 |
| 94 // Send the PDF data to the cloud to print. |
| 95 void SendCloudPrintJob(const DictionaryValue& settings, |
| 96 std::string print_ticket); |
84 | 97 |
85 // Helper function to get the initiator tab for the print preview tab. | 98 // Helper function to get the initiator tab for the print preview tab. |
86 TabContents* GetInitiatorTab(); | 99 TabContents* GetInitiatorTab(); |
87 | 100 |
88 // Helper function to close the print preview tab. | 101 // Helper function to close the print preview tab. |
89 void ClosePrintPreviewTab(); | 102 void ClosePrintPreviewTab(); |
90 | 103 |
91 // Helper function to activate the initiator tab and close the preview tab. | 104 // Helper function to activate the initiator tab and close the preview tab. |
92 void ActivateInitiatorTabAndClosePreviewTab(); | 105 void ActivateInitiatorTabAndClosePreviewTab(); |
93 | 106 |
(...skipping 19 matching lines...) Expand all Loading... |
113 // Whether we have already logged a failed print preview. | 126 // Whether we have already logged a failed print preview. |
114 bool reported_failed_preview_; | 127 bool reported_failed_preview_; |
115 | 128 |
116 // Whether we have already logged the number of printers this session. | 129 // Whether we have already logged the number of printers this session. |
117 bool has_logged_printers_count_; | 130 bool has_logged_printers_count_; |
118 | 131 |
119 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 132 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
120 }; | 133 }; |
121 | 134 |
122 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 135 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
OLD | NEW |