| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 int index, | 43 int index, |
| 44 void* params) OVERRIDE; | 44 void* params) OVERRIDE; |
| 45 virtual void FileSelectionCanceled(void* params) OVERRIDE; | 45 virtual void FileSelectionCanceled(void* params) OVERRIDE; |
| 46 | 46 |
| 47 // PrintViewManagerObserver implementation. | 47 // PrintViewManagerObserver implementation. |
| 48 virtual void OnPrintDialogShown() OVERRIDE; | 48 virtual void OnPrintDialogShown() OVERRIDE; |
| 49 | 49 |
| 50 // Displays a modal dialog, prompting the user to select a file. | 50 // Displays a modal dialog, prompting the user to select a file. |
| 51 void SelectFile(const FilePath& default_path); | 51 void SelectFile(const FilePath& default_path); |
| 52 | 52 |
| 53 // Called when the print preview tab navigates. This is the last time this | 53 // Called when the print preview tab is destroyed. This is the last time |
| 54 // this object has access to the PrintViewManager in order to disconnect the | 54 // this object has access to the PrintViewManager in order to disconnect the |
| 55 // observer. | 55 // observer. |
| 56 void OnNavigation(); | 56 void OnTabDestroyed(); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 friend class PrintSystemTaskProxy; | 59 friend class PrintSystemTaskProxy; |
| 60 | 60 |
| 61 TabContents* preview_tab(); | 61 TabContents* preview_tab(); |
| 62 | 62 |
| 63 // Gets the default printer. |args| is unused. | 63 // Gets the default printer. |args| is unused. |
| 64 void HandleGetDefaultPrinter(const base::ListValue* args); | 64 void HandleGetDefaultPrinter(const base::ListValue* args); |
| 65 | 65 |
| 66 // Gets the list of printers. |args| is unused. | 66 // Gets the list of printers. |args| is unused. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 90 void HandleGetPrinterCapabilities(const base::ListValue* args); | 90 void HandleGetPrinterCapabilities(const base::ListValue* args); |
| 91 | 91 |
| 92 // Asks the initiator renderer to show the native print system dialog. |args| | 92 // Asks the initiator renderer to show the native print system dialog. |args| |
| 93 // is unused. | 93 // is unused. |
| 94 void HandleShowSystemDialog(const base::ListValue* args); | 94 void HandleShowSystemDialog(const base::ListValue* args); |
| 95 | 95 |
| 96 // Brings up a web page to allow the user to configure cloud print. | 96 // Brings up a web page to allow the user to configure cloud print. |
| 97 // |args| is unused. | 97 // |args| is unused. |
| 98 void HandleManageCloudPrint(const base::ListValue* args); | 98 void HandleManageCloudPrint(const base::ListValue* args); |
| 99 | 99 |
| 100 // Reloads the initiator tab and closes the associated preview tab. |
| 101 void HandleReloadCrashedInitiatorTab(const base::ListValue* args); |
| 102 |
| 100 // Asks the browser to show the native printer management dialog. | 103 // Asks the browser to show the native printer management dialog. |
| 101 // |args| is unused. | 104 // |args| is unused. |
| 102 void HandleManagePrinters(const base::ListValue* args); | 105 void HandleManagePrinters(const base::ListValue* args); |
| 103 | 106 |
| 104 // Asks the browser to close the preview tab. |args| is unused. | 107 // Asks the browser to close the preview tab. |args| is unused. |
| 105 void HandleClosePreviewTab(const base::ListValue* args); | 108 void HandleClosePreviewTab(const base::ListValue* args); |
| 106 | 109 |
| 107 // Sends the printer capabilities to the Web UI. |settings_info| contains | 110 // Sends the printer capabilities to the Web UI. |settings_info| contains |
| 108 // printer capabilities information. | 111 // printer capabilities information. |
| 109 void SendPrinterCapabilities(const base::DictionaryValue& settings_info); | 112 void SendPrinterCapabilities(const base::DictionaryValue& settings_info); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // Whether we have already logged a failed print preview. | 164 // Whether we have already logged a failed print preview. |
| 162 bool reported_failed_preview_; | 165 bool reported_failed_preview_; |
| 163 | 166 |
| 164 // Whether we have already logged the number of printers this session. | 167 // Whether we have already logged the number of printers this session. |
| 165 bool has_logged_printers_count_; | 168 bool has_logged_printers_count_; |
| 166 | 169 |
| 167 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 170 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
| 168 }; | 171 }; |
| 169 | 172 |
| 170 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 173 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
| OLD | NEW |