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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void HandleCancelPendingPrintRequest(const ListValue* args); | 67 void HandleCancelPendingPrintRequest(const ListValue* args); |
66 | 68 |
67 // Get the printer capabilities. | 69 // Get the printer capabilities. |
68 // First element of |args| is the printer name. | 70 // First element of |args| is the printer name. |
69 void HandleGetPrinterCapabilities(const ListValue* args); | 71 void HandleGetPrinterCapabilities(const ListValue* args); |
70 | 72 |
71 // Ask the initiator renderer to show the native print system dialog. | 73 // Ask the initiator renderer to show the native print system dialog. |
72 // |args| is unused. | 74 // |args| is unused. |
73 void HandleShowSystemDialog(const ListValue* args); | 75 void HandleShowSystemDialog(const ListValue* args); |
74 | 76 |
| 77 // Bring up a web page to allow the user to configure cloud print. |
| 78 // |args| is unused. |
| 79 void HandleManageCloudPrint(const ListValue* args); |
| 80 |
75 // Ask the browser to show the native printer management dialog. | 81 // Ask the browser to show the native printer management dialog. |
76 // |args| is unused. | 82 // |args| is unused. |
77 void HandleManagePrinters(const ListValue* args); | 83 void HandleManagePrinters(const ListValue* args); |
78 | 84 |
79 // Ask the browser to close the preview tab. | 85 // Ask the browser to close the preview tab. |
80 // |args| is unused. | 86 // |args| is unused. |
81 void HandleClosePreviewTab(const ListValue* args); | 87 void HandleClosePreviewTab(const ListValue* args); |
82 | 88 |
83 // Send the printer capabilities to the Web UI. | 89 // Send the printer capabilities to the Web UI. |
84 // |settings_info| contains printer capabilities information. | 90 // |settings_info| contains printer capabilities information. |
85 void SendPrinterCapabilities(const DictionaryValue& settings_info); | 91 void SendPrinterCapabilities(const DictionaryValue& settings_info); |
86 | 92 |
87 // Send the default printer to the Web UI. | 93 // Send the default printer to the Web UI. |
88 void SendDefaultPrinter(const StringValue& default_printer); | 94 void SendDefaultPrinter(const StringValue& default_printer); |
89 | 95 |
90 // Send the list of printers to the Web UI. | 96 // Send the list of printers to the Web UI. |
91 void SendPrinterList(const ListValue& printers); | 97 void SetupPrinterList(const ListValue& printers); |
| 98 |
| 99 // Send whether cloud print integration should be enabled. |
| 100 void SendCloudPrintEnabled(); |
| 101 |
| 102 // Send the PDF data to the cloud to print. |
| 103 void SendCloudPrintJob(const DictionaryValue& settings, |
| 104 std::string print_ticket); |
92 | 105 |
93 // Helper function to get the initiator tab for the print preview tab. | 106 // Helper function to get the initiator tab for the print preview tab. |
94 TabContents* GetInitiatorTab(); | 107 TabContents* GetInitiatorTab(); |
95 | 108 |
96 // Helper function to close the print preview tab. | 109 // Helper function to close the print preview tab. |
97 void ClosePrintPreviewTab(); | 110 void ClosePrintPreviewTab(); |
98 | 111 |
99 // Helper function to activate the initiator tab and close the preview tab. | 112 // Helper function to activate the initiator tab and close the preview tab. |
100 void ActivateInitiatorTabAndClosePreviewTab(); | 113 void ActivateInitiatorTabAndClosePreviewTab(); |
101 | 114 |
(...skipping 25 matching lines...) Expand all Loading... |
127 // Whether we have already logged a failed print preview. | 140 // Whether we have already logged a failed print preview. |
128 bool reported_failed_preview_; | 141 bool reported_failed_preview_; |
129 | 142 |
130 // Whether we have already logged the number of printers this session. | 143 // Whether we have already logged the number of printers this session. |
131 bool has_logged_printers_count_; | 144 bool has_logged_printers_count_; |
132 | 145 |
133 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 146 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
134 }; | 147 }; |
135 | 148 |
136 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 149 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
OLD | NEW |