| OLD | NEW |
| 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 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "chrome/common/features.h" | 16 #include "chrome/common/features.h" |
| 17 #include "components/signin/core/browser/gaia_cookie_manager_service.h" | 17 #include "components/signin/core/browser/gaia_cookie_manager_service.h" |
| 18 #include "content/public/browser/web_ui_message_handler.h" | 18 #include "content/public/browser/web_ui_message_handler.h" |
| 19 #include "printing/backend/print_backend.h" |
| 19 #include "printing/features/features.h" | 20 #include "printing/features/features.h" |
| 20 #include "ui/shell_dialogs/select_file_dialog.h" | 21 #include "ui/shell_dialogs/select_file_dialog.h" |
| 21 | 22 |
| 22 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) | 23 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) |
| 23 #include "chrome/browser/local_discovery/service_discovery_shared_client.h" | 24 #include "chrome/browser/local_discovery/service_discovery_shared_client.h" |
| 24 #include "chrome/browser/printing/cloud_print/privet_local_printer_lister.h" | 25 #include "chrome/browser/printing/cloud_print/privet_local_printer_lister.h" |
| 25 #endif | 26 #endif |
| 26 | 27 |
| 27 class PrinterHandler; | 28 class PrinterHandler; |
| 28 class PrintPreviewUI; | 29 class PrintPreviewUI; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 const std::string& access_token); | 208 const std::string& access_token); |
| 208 | 209 |
| 209 // Sends the printer capabilities to the Web UI. |settings_info| contains | 210 // Sends the printer capabilities to the Web UI. |settings_info| contains |
| 210 // printer capabilities information. If |settings_info| is empty, sends | 211 // printer capabilities information. If |settings_info| is empty, sends |
| 211 // error notification to the Web UI instead. | 212 // error notification to the Web UI instead. |
| 212 void SendPrinterCapabilities( | 213 void SendPrinterCapabilities( |
| 213 const std::string& printer_name, | 214 const std::string& printer_name, |
| 214 std::unique_ptr<base::DictionaryValue> settings_info); | 215 std::unique_ptr<base::DictionaryValue> settings_info); |
| 215 | 216 |
| 216 // Send the list of printers to the Web UI. | 217 // Send the list of printers to the Web UI. |
| 217 void SetupPrinterList(const base::ListValue* printers); | 218 void SetupPrinterList(const printing::PrinterList& printer_list); |
| 218 | 219 |
| 219 // Send whether cloud print integration should be enabled. | 220 // Send whether cloud print integration should be enabled. |
| 220 void SendCloudPrintEnabled(); | 221 void SendCloudPrintEnabled(); |
| 221 | 222 |
| 222 // Send the PDF data to the cloud to print. | 223 // Send the PDF data to the cloud to print. |
| 223 void SendCloudPrintJob(const base::RefCountedBytes* data); | 224 void SendCloudPrintJob(const base::RefCountedBytes* data); |
| 224 | 225 |
| 225 // Handles printing to PDF. | 226 // Handles printing to PDF. |
| 226 void PrintToPdf(); | 227 void PrintToPdf(); |
| 227 | 228 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 // Notifies tests that want to know if the PDF has been saved. This doesn't | 380 // Notifies tests that want to know if the PDF has been saved. This doesn't |
| 380 // notify the test if it was a successful save, only that it was attempted. | 381 // notify the test if it was a successful save, only that it was attempted. |
| 381 base::Closure pdf_file_saved_closure_; | 382 base::Closure pdf_file_saved_closure_; |
| 382 | 383 |
| 383 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; | 384 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; |
| 384 | 385 |
| 385 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 386 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
| 386 }; | 387 }; |
| 387 | 388 |
| 388 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 389 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
| OLD | NEW |