| 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 "components/signin/core/browser/gaia_cookie_manager_service.h" | 17 #include "components/signin/core/browser/gaia_cookie_manager_service.h" |
| 17 #include "content/public/browser/web_ui_message_handler.h" | 18 #include "content/public/browser/web_ui_message_handler.h" |
| 18 #include "ui/shell_dialogs/select_file_dialog.h" | 19 #include "ui/shell_dialogs/select_file_dialog.h" |
| 19 | 20 |
| 20 #if defined(ENABLE_SERVICE_DISCOVERY) | 21 #if defined(ENABLE_SERVICE_DISCOVERY) |
| 21 #include "chrome/browser/local_discovery/service_discovery_shared_client.h" | 22 #include "chrome/browser/local_discovery/service_discovery_shared_client.h" |
| 22 #include "chrome/browser/printing/cloud_print/privet_local_printer_lister.h" | 23 #include "chrome/browser/printing/cloud_print/privet_local_printer_lister.h" |
| 23 #endif // defined(ENABLE_SERVICE_DISCOVERY) | 24 #endif // defined(ENABLE_SERVICE_DISCOVERY) |
| 24 | 25 |
| 25 class PrinterHandler; | 26 class PrinterHandler; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Handles the request to cancel the pending print request. |args| is unused. | 143 // Handles the request to cancel the pending print request. |args| is unused. |
| 143 void HandleCancelPendingPrintRequest(const base::ListValue* args); | 144 void HandleCancelPendingPrintRequest(const base::ListValue* args); |
| 144 | 145 |
| 145 // Handles a request to store data that the web ui wishes to persist. | 146 // Handles a request to store data that the web ui wishes to persist. |
| 146 // First element of |args| is the data to persist. | 147 // First element of |args| is the data to persist. |
| 147 void HandleSaveAppState(const base::ListValue* args); | 148 void HandleSaveAppState(const base::ListValue* args); |
| 148 | 149 |
| 149 // Gets the printer capabilities. First element of |args| is the printer name. | 150 // Gets the printer capabilities. First element of |args| is the printer name. |
| 150 void HandleGetPrinterCapabilities(const base::ListValue* args); | 151 void HandleGetPrinterCapabilities(const base::ListValue* args); |
| 151 | 152 |
| 152 #if defined(ENABLE_BASIC_PRINTING) | 153 #if BUILDFLAG(ENABLE_BASIC_PRINT_DIALOG) |
| 153 // Asks the initiator renderer to show the native print system dialog. |args| | 154 // Asks the initiator renderer to show the native print system dialog. |args| |
| 154 // is unused. | 155 // is unused. |
| 155 void HandleShowSystemDialog(const base::ListValue* args); | 156 void HandleShowSystemDialog(const base::ListValue* args); |
| 156 #endif // defined(ENABLE_BASIC_PRINTING) | 157 #endif |
| 157 | 158 |
| 158 // Callback for the signin dialog to call once signin is complete. | 159 // Callback for the signin dialog to call once signin is complete. |
| 159 void OnSigninComplete(); | 160 void OnSigninComplete(); |
| 160 | 161 |
| 161 // Brings up a dialog to allow the user to sign into cloud print. | 162 // Brings up a dialog to allow the user to sign into cloud print. |
| 162 // |args| is unused. | 163 // |args| is unused. |
| 163 void HandleSignin(const base::ListValue* args); | 164 void HandleSignin(const base::ListValue* args); |
| 164 | 165 |
| 165 // Generates new token and sends back to UI. | 166 // Generates new token and sends back to UI. |
| 166 void HandleGetAccessToken(const base::ListValue* args); | 167 void HandleGetAccessToken(const base::ListValue* args); |
| (...skipping 212 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 |