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> | 9 #include <string> |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 void HandleShowSystemDialog(const base::ListValue* args); | 117 void HandleShowSystemDialog(const base::ListValue* args); |
118 | 118 |
119 // Brings up a dialog to allow the user to sign into cloud print. | 119 // Brings up a dialog to allow the user to sign into cloud print. |
120 // |args| is unused. | 120 // |args| is unused. |
121 void HandleSignin(const base::ListValue* args); | 121 void HandleSignin(const base::ListValue* args); |
122 | 122 |
123 // Brings up a web page to allow the user to configure cloud print. | 123 // Brings up a web page to allow the user to configure cloud print. |
124 // |args| is unused. | 124 // |args| is unused. |
125 void HandleManageCloudPrint(const base::ListValue* args); | 125 void HandleManageCloudPrint(const base::ListValue* args); |
126 | 126 |
127 // Gathers UMA stats when the print preview tab is about to close. | 127 // Reloads the initiator tab and closes the associated preview tab. |args| is |
128 // |args| is unused. | 128 // unused. |
129 void HandleClosePreviewTab(const base::ListValue* args); | 129 void HandleReloadCrashedInitiatorTab(const base::ListValue* args); |
130 | 130 |
131 // Asks the browser to show the native printer management dialog. | 131 // Asks the browser to show the native printer management dialog. |
132 // |args| is unused. | 132 // |args| is unused. |
133 void HandleManagePrinters(const base::ListValue* args); | 133 void HandleManagePrinters(const base::ListValue* args); |
134 | 134 |
135 // Asks the browser to show the cloud print dialog. | 135 // Asks the browser to show the cloud print dialog. |
136 void HandlePrintWithCloudPrint(); | 136 void HandlePrintWithCloudPrint(); |
137 | 137 |
| 138 // Asks the browser to close the preview tab. |args| is unused. |
| 139 void HandleClosePreviewTab(const base::ListValue* args); |
| 140 |
138 // Asks the browser for several settings that are needed before the first | 141 // Asks the browser for several settings that are needed before the first |
139 // preview is displayed. | 142 // preview is displayed. |
140 void HandleGetInitialSettings(const base::ListValue* args); | 143 void HandleGetInitialSettings(const base::ListValue* args); |
141 | 144 |
142 void SendInitialSettings( | 145 void SendInitialSettings( |
143 const std::string& default_printer, | 146 const std::string& default_printer, |
144 const std::string& cloud_print_data); | 147 const std::string& cloud_print_data); |
145 | 148 |
146 // Sends the printer capabilities to the Web UI. |settings_info| contains | 149 // Sends the printer capabilities to the Web UI. |settings_info| contains |
147 // printer capabilities information. | 150 // printer capabilities information. |
148 void SendPrinterCapabilities(const base::DictionaryValue& settings_info); | 151 void SendPrinterCapabilities(const base::DictionaryValue& settings_info); |
149 | 152 |
150 // Send the list of printers to the Web UI. | 153 // Send the list of printers to the Web UI. |
151 void SetupPrinterList(const base::ListValue& printers); | 154 void SetupPrinterList(const base::ListValue& printers); |
152 | 155 |
153 // Send whether cloud print integration should be enabled. | 156 // Send whether cloud print integration should be enabled. |
154 void SendCloudPrintEnabled(); | 157 void SendCloudPrintEnabled(); |
155 | 158 |
156 // Send the PDF data to the cloud to print. | 159 // Send the PDF data to the cloud to print. |
157 void SendCloudPrintJob(const base::DictionaryValue& settings, | 160 void SendCloudPrintJob(const base::DictionaryValue& settings, |
158 std::string print_ticket); | 161 std::string print_ticket); |
159 | 162 |
160 // Gets the initiator tab for the print preview tab. | 163 // Gets the initiator tab for the print preview tab. |
161 TabContentsWrapper* GetInitiatorTab() const; | 164 TabContentsWrapper* GetInitiatorTab() const; |
162 | 165 |
| 166 // Closes the print preview tab. |
| 167 void ClosePrintPreviewTab(); |
| 168 |
163 // Activates the initiator tab and close the preview tab. | 169 // Activates the initiator tab and close the preview tab. |
164 void ActivateInitiatorTabAndClosePreviewTab(); | 170 void ActivateInitiatorTabAndClosePreviewTab(); |
165 | 171 |
166 // Adds all the recorded stats taken so far to histogram counts. | 172 // Adds all the recorded stats taken so far to histogram counts. |
167 void ReportStats(); | 173 void ReportStats(); |
168 | 174 |
| 175 // Hides the preview tab for printing. |
| 176 void HidePreviewTab(); |
| 177 |
169 // Clears initiator tab details for this preview tab. | 178 // Clears initiator tab details for this preview tab. |
170 void ClearInitiatorTabDetails(); | 179 void ClearInitiatorTabDetails(); |
171 | 180 |
172 // Posts a task to save to pdf at |print_to_pdf_path_|. | 181 // Posts a task to save to pdf at |print_to_pdf_path_|. |
173 void PostPrintToPdfTask(); | 182 void PostPrintToPdfTask(); |
174 | 183 |
175 // Populates |settings| according to the current locale. | 184 // Populates |settings| according to the current locale. |
176 void GetNumberFormatAndMeasurementSystem(base::DictionaryValue* settings); | 185 void GetNumberFormatAndMeasurementSystem(base::DictionaryValue* settings); |
177 | 186 |
178 // Populates |last_used_custom_margins| according to the last used margin | 187 // Populates |last_used_custom_margins| according to the last used margin |
(...skipping 28 matching lines...) Expand all Loading... |
207 bool has_logged_printers_count_; | 216 bool has_logged_printers_count_; |
208 | 217 |
209 // Holds the path to the print to pdf request. It is empty if no such request | 218 // Holds the path to the print to pdf request. It is empty if no such request |
210 // exists. | 219 // exists. |
211 scoped_ptr<FilePath> print_to_pdf_path_; | 220 scoped_ptr<FilePath> print_to_pdf_path_; |
212 | 221 |
213 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 222 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
214 }; | 223 }; |
215 | 224 |
216 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 225 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
OLD | NEW |