Chromium Code Reviews| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 // Called when the print preview tab navigates. This is the last time this | 53 // Called when the print preview tab navigates. This is the last time this |
| 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 OnNavigation(); |
| 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 // Get the default printer. |args| is unused. | 63 // Gets the default printer. |args| is unused. |
|
Lei Zhang
2011/08/09 20:51:19
Can you put all these comment changes into a separ
kmadhusu
2011/08/10 16:46:59
Done.
| |
| 64 void HandleGetDefaultPrinter(const base::ListValue* args); | 64 void HandleGetDefaultPrinter(const base::ListValue* args); |
| 65 | 65 |
| 66 // Get the list of printers. |args| is unused. | 66 // Gets the list of printers. |args| is unused. |
| 67 void HandleGetPrinters(const base::ListValue* args); | 67 void HandleGetPrinters(const base::ListValue* args); |
| 68 | 68 |
| 69 // Ask the initiator renderer to generate a preview. | 69 // Asks the initiator renderer to generate a preview. First element of |args| |
| 70 // First element of |args| is a job settings JSON string. | 70 // is a job settings JSON string. |
| 71 void HandleGetPreview(const base::ListValue* args); | 71 void HandleGetPreview(const base::ListValue* args); |
| 72 | 72 |
| 73 // Get the job settings from Web UI and initiate printing. | 73 // Gets the job settings from Web UI and initiate printing. First element of |
| 74 // First element of |args| is a job settings JSON string. | 74 // |args| is a job settings JSON string. |
| 75 void HandlePrint(const base::ListValue* args); | 75 void HandlePrint(const base::ListValue* args); |
| 76 | 76 |
| 77 // Handles the request to hide the preview tab for printing. | 77 // Handles the request to hide the preview tab for printing. |args| is unused. |
| 78 // |args| is unused. | |
| 79 void HandleHidePreview(const base::ListValue* args); | 78 void HandleHidePreview(const base::ListValue* args); |
| 80 | 79 |
| 81 // Handles the request to cancel the pending print request. | 80 // Handles the request to cancel the pending print request. |args| is unused. |
| 82 // |args| is unused. | |
| 83 void HandleCancelPendingPrintRequest(const base::ListValue* args); | 81 void HandleCancelPendingPrintRequest(const base::ListValue* args); |
| 84 | 82 |
| 85 // Handles a request to back up data about the last used cloud print | 83 // Handles a request to back up data about the last used cloud print |
| 86 // printer. | 84 // printer. |
| 87 // First element of |args| is the printer name. | 85 // First element of |args| is the printer name. |
| 88 // Second element of |args| is the current cloud print data JSON. | 86 // Second element of |args| is the current cloud print data JSON. |
| 89 void HandleSaveLastPrinter(const base::ListValue* args); | 87 void HandleSaveLastPrinter(const base::ListValue* args); |
| 90 | 88 |
| 91 // Get the printer capabilities. | 89 // Gets the printer capabilities. First element of |args| is the printer name. |
| 92 // First element of |args| is the printer name. | |
| 93 void HandleGetPrinterCapabilities(const base::ListValue* args); | 90 void HandleGetPrinterCapabilities(const base::ListValue* args); |
| 94 | 91 |
| 95 // Ask the initiator renderer to show the native print system dialog. | 92 // Asks the initiator renderer to show the native print system dialog. |args| |
| 96 // |args| is unused. | 93 // is unused. |
| 97 void HandleShowSystemDialog(const base::ListValue* args); | 94 void HandleShowSystemDialog(const base::ListValue* args); |
| 98 | 95 |
| 99 // Bring 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. |
| 100 // |args| is unused. | 97 // |args| is unused. |
| 101 void HandleManageCloudPrint(const base::ListValue* args); | 98 void HandleManageCloudPrint(const base::ListValue* args); |
| 102 | 99 |
| 103 // Ask the browser to show the native printer management dialog. | 100 // Asks the browser to show the native printer management dialog. |
| 104 // |args| is unused. | 101 // |args| is unused. |
| 105 void HandleManagePrinters(const base::ListValue* args); | 102 void HandleManagePrinters(const base::ListValue* args); |
| 106 | 103 |
| 107 // Ask the browser to close the preview tab. | 104 // Reloads the initiator tab and closes the associated preview tab. |
| 108 // |args| is unused. | 105 void HandleReloadCrashedInitiatorTab(const base::ListValue* args); |
| 106 | |
| 107 // Asks the browser to close the preview tab. |args| is unused. | |
| 109 void HandleClosePreviewTab(const base::ListValue* args); | 108 void HandleClosePreviewTab(const base::ListValue* args); |
| 110 | 109 |
| 111 // Send the printer capabilities to the Web UI. | 110 // Sends the printer capabilities to the Web UI. |settings_info| contains |
| 112 // |settings_info| contains printer capabilities information. | 111 // printer capabilities information. |
| 113 void SendPrinterCapabilities(const base::DictionaryValue& settings_info); | 112 void SendPrinterCapabilities(const base::DictionaryValue& settings_info); |
| 114 | 113 |
| 115 // Send the default printer to the Web UI. | 114 // Sends the default printer to the Web UI. |
| 116 void SendDefaultPrinter(const base::StringValue& default_printer, | 115 void SendDefaultPrinter(const base::StringValue& default_printer, |
| 117 const base::StringValue& cloud_print_data); | 116 const base::StringValue& cloud_print_data); |
| 118 | 117 |
| 119 // Send the list of printers to the Web UI. | 118 // Send the list of printers to the Web UI. |
| 120 void SetupPrinterList(const base::ListValue& printers); | 119 void SetupPrinterList(const base::ListValue& printers); |
| 121 | 120 |
| 122 // Send whether cloud print integration should be enabled. | 121 // Send whether cloud print integration should be enabled. |
| 123 void SendCloudPrintEnabled(); | 122 void SendCloudPrintEnabled(); |
| 124 | 123 |
| 125 // Send the PDF data to the cloud to print. | 124 // Send the PDF data to the cloud to print. |
| 126 void SendCloudPrintJob(const base::DictionaryValue& settings, | 125 void SendCloudPrintJob(const base::DictionaryValue& settings, |
| 127 std::string print_ticket); | 126 std::string print_ticket); |
| 128 | 127 |
| 129 // Helper function to get the initiator tab for the print preview tab. | 128 // Sends the list of printers to the Web UI. |
| 129 void SendPrinterList(const base::ListValue& printers); | |
|
Lei Zhang
2011/08/09 20:51:19
Bad merge?
kmadhusu
2011/08/10 16:46:59
my bad.. fixed.
| |
| 130 | |
| 131 // Gets the initiator tab for the print preview tab. | |
| 130 TabContents* GetInitiatorTab(); | 132 TabContents* GetInitiatorTab(); |
| 131 | 133 |
| 132 // Helper function to close the print preview tab. | 134 // Closes the print preview tab. |
| 133 void ClosePrintPreviewTab(); | 135 void ClosePrintPreviewTab(); |
| 134 | 136 |
| 135 // Helper function to activate the initiator tab and close the preview tab. | 137 // Activates the initiator tab and close the preview tab. |
| 136 void ActivateInitiatorTabAndClosePreviewTab(); | 138 void ActivateInitiatorTabAndClosePreviewTab(); |
| 137 | 139 |
| 138 // Adds all the recorded stats taken so far to histogram counts. | 140 // Adds all the recorded stats taken so far to histogram counts. |
| 139 void ReportStats(); | 141 void ReportStats(); |
| 140 | 142 |
| 141 // Helper function to hide the preview tab for printing. | 143 // Hides the preview tab for printing. |
| 142 void HidePreviewTab(); | 144 void HidePreviewTab(); |
| 143 | 145 |
| 144 // Helper function to clear initiator tab details for this preview tab. | 146 // Clears initiator tab details for this preview tab. |
| 145 void ClearInitiatorTabDetails(); | 147 void ClearInitiatorTabDetails(); |
| 146 | 148 |
| 147 // Pointer to current print system. | 149 // Pointer to current print system. |
| 148 scoped_refptr<printing::PrintBackend> print_backend_; | 150 scoped_refptr<printing::PrintBackend> print_backend_; |
| 149 | 151 |
| 150 // The underlying dialog object. | 152 // The underlying dialog object. |
| 151 scoped_refptr<SelectFileDialog> select_file_dialog_; | 153 scoped_refptr<SelectFileDialog> select_file_dialog_; |
| 152 | 154 |
| 153 static FilePath* last_saved_path_; | 155 static FilePath* last_saved_path_; |
| 154 static std::string* last_used_printer_cloud_print_data_; | 156 static std::string* last_used_printer_cloud_print_data_; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 165 // Whether we have already logged a failed print preview. | 167 // Whether we have already logged a failed print preview. |
| 166 bool reported_failed_preview_; | 168 bool reported_failed_preview_; |
| 167 | 169 |
| 168 // Whether we have already logged the number of printers this session. | 170 // Whether we have already logged the number of printers this session. |
| 169 bool has_logged_printers_count_; | 171 bool has_logged_printers_count_; |
| 170 | 172 |
| 171 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 173 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
| 172 }; | 174 }; |
| 173 | 175 |
| 174 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 176 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
| OLD | NEW |