Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.h

Issue 2606043004: Perform printer setup on Chrome OS before selecting printer. (Closed)
Patch Set: fix nits Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PRINT_PREVIEW_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // Handles the request to cancel the pending print request. |args| is unused. 148 // Handles the request to cancel the pending print request. |args| is unused.
149 void HandleCancelPendingPrintRequest(const base::ListValue* args); 149 void HandleCancelPendingPrintRequest(const base::ListValue* args);
150 150
151 // Handles a request to store data that the web ui wishes to persist. 151 // Handles a request to store data that the web ui wishes to persist.
152 // First element of |args| is the data to persist. 152 // First element of |args| is the data to persist.
153 void HandleSaveAppState(const base::ListValue* args); 153 void HandleSaveAppState(const base::ListValue* args);
154 154
155 // Gets the printer capabilities. First element of |args| is the printer name. 155 // Gets the printer capabilities. First element of |args| is the printer name.
156 void HandleGetPrinterCapabilities(const base::ListValue* args); 156 void HandleGetPrinterCapabilities(const base::ListValue* args);
157 157
158 // Performs printer setup. First element of |args| is the printer name.
159 void HandlePrinterSetup(const base::ListValue* args);
160
158 #if BUILDFLAG(ENABLE_BASIC_PRINT_DIALOG) 161 #if BUILDFLAG(ENABLE_BASIC_PRINT_DIALOG)
159 // Asks the initiator renderer to show the native print system dialog. |args| 162 // Asks the initiator renderer to show the native print system dialog. |args|
160 // is unused. 163 // is unused.
161 void HandleShowSystemDialog(const base::ListValue* args); 164 void HandleShowSystemDialog(const base::ListValue* args);
162 #endif 165 #endif
163 166
164 // Callback for the signin dialog to call once signin is complete. 167 // Callback for the signin dialog to call once signin is complete.
165 void OnSigninComplete(); 168 void OnSigninComplete();
166 169
167 // Brings up a dialog to allow the user to sign into cloud print. 170 // Brings up a dialog to allow the user to sign into cloud print.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 void SendAccessToken(const std::string& type, 215 void SendAccessToken(const std::string& type,
213 const std::string& access_token); 216 const std::string& access_token);
214 217
215 // Sends the printer capabilities to the Web UI. |settings_info| contains 218 // Sends the printer capabilities to the Web UI. |settings_info| contains
216 // printer capabilities information. If |settings_info| is empty, sends 219 // printer capabilities information. If |settings_info| is empty, sends
217 // error notification to the Web UI instead. 220 // error notification to the Web UI instead.
218 void SendPrinterCapabilities( 221 void SendPrinterCapabilities(
219 const std::string& printer_name, 222 const std::string& printer_name,
220 std::unique_ptr<base::DictionaryValue> settings_info); 223 std::unique_ptr<base::DictionaryValue> settings_info);
221 224
225 // Send the result of performing printer setup. |settings_info| contains
226 // printer capabilities.
227 void SendPrinterSetup(const std::string& callback_id,
228 const std::string& printer_name,
229 std::unique_ptr<base::DictionaryValue> settings_info);
230
222 // Send the list of printers to the Web UI. 231 // Send the list of printers to the Web UI.
223 void SetupPrinterList(const printing::PrinterList& printer_list); 232 void SetupPrinterList(const printing::PrinterList& printer_list);
224 233
225 // Send whether cloud print integration should be enabled. 234 // Send whether cloud print integration should be enabled.
226 void SendCloudPrintEnabled(); 235 void SendCloudPrintEnabled();
227 236
228 // Send the PDF data to the cloud to print. 237 // Send the PDF data to the cloud to print.
229 void SendCloudPrintJob(const base::RefCountedBytes* data); 238 void SendCloudPrintJob(const base::RefCountedBytes* data);
230 239
231 // Handles printing to PDF. 240 // Handles printing to PDF.
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 // Proxy for calls to the print backend. Lazily initialized since web_ui() is 398 // Proxy for calls to the print backend. Lazily initialized since web_ui() is
390 // not available at construction time. 399 // not available at construction time.
391 std::unique_ptr<printing::PrinterBackendProxy> printer_backend_proxy_; 400 std::unique_ptr<printing::PrinterBackendProxy> printer_backend_proxy_;
392 401
393 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; 402 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_;
394 403
395 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); 404 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler);
396 }; 405 };
397 406
398 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ 407 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698