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. | |
Lei Zhang
2011/06/09 21:23:30
nit: indentation, describe what |args| does.
Albert Bodenhamer
2011/06/10 01:29:36
Done.
| |
70 void HandleManageCloudPrint(const ListValue* args); | |
71 | |
67 // Ask the browser to show the native printer management dialog. | 72 // Ask the browser to show the native printer management dialog. |
68 // |args| is unused. | 73 // |args| is unused. |
69 void HandleManagePrinters(const ListValue* args); | 74 void HandleManagePrinters(const ListValue* args); |
70 | 75 |
71 // Ask the browser to close the preview tab. | 76 // Ask the browser to close the preview tab. |
72 // |args| is unused. | 77 // |args| is unused. |
73 void HandleClosePreviewTab(const ListValue* args); | 78 void HandleClosePreviewTab(const ListValue* args); |
74 | 79 |
75 // Send the printer capabilities to the Web UI. | 80 // Send the printer capabilities to the Web UI. |
76 // |settings_info| contains printer capabilities information. | 81 // |settings_info| contains printer capabilities information. |
77 void SendPrinterCapabilities(const DictionaryValue& settings_info); | 82 void SendPrinterCapabilities(const DictionaryValue& settings_info); |
78 | 83 |
79 // Send the default printer to the Web UI. | 84 // Send the default printer to the Web UI. |
80 void SendDefaultPrinter(const StringValue& default_printer); | 85 void SendDefaultPrinter(const StringValue& default_printer); |
81 | 86 |
82 // Send the list of printers to the Web UI. | 87 // Send the list of printers to the Web UI. |
83 void SendPrinterList(const ListValue& printers, | 88 void SetupPrinterList(const ListValue& printers, |
84 const FundamentalValue& default_printer_index); | 89 const FundamentalValue& default_printer_index); |
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); | |
85 | 97 |
86 // 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. |
87 TabContents* GetInitiatorTab(); | 99 TabContents* GetInitiatorTab(); |
88 | 100 |
89 // Helper function to close the print preview tab. | 101 // Helper function to close the print preview tab. |
90 void ClosePrintPreviewTab(); | 102 void ClosePrintPreviewTab(); |
91 | 103 |
92 // 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. |
93 void ActivateInitiatorTabAndClosePreviewTab(); | 105 void ActivateInitiatorTabAndClosePreviewTab(); |
94 | 106 |
(...skipping 18 matching lines...) Expand all Loading... | |
113 // Whether we have already logged a failed print preview. | 125 // Whether we have already logged a failed print preview. |
114 bool reported_failed_preview_; | 126 bool reported_failed_preview_; |
115 | 127 |
116 // Whether we have already logged the number of printers this session. | 128 // Whether we have already logged the number of printers this session. |
117 bool has_logged_printers_count_; | 129 bool has_logged_printers_count_; |
118 | 130 |
119 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 131 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
120 }; | 132 }; |
121 | 133 |
122 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 134 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
OLD | NEW |