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

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

Issue 7604042: Clean up CL to fix the member function comments and to validate the print preview WebUI. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix compile error Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
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
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.
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 // Asks the browser to close the preview tab. |args| is unused.
108 // |args| is unused.
109 void HandleClosePreviewTab(const base::ListValue* args); 105 void HandleClosePreviewTab(const base::ListValue* args);
110 106
111 // Send the printer capabilities to the Web UI. 107 // Sends the printer capabilities to the Web UI. |settings_info| contains
112 // |settings_info| contains printer capabilities information. 108 // printer capabilities information.
113 void SendPrinterCapabilities(const base::DictionaryValue& settings_info); 109 void SendPrinterCapabilities(const base::DictionaryValue& settings_info);
114 110
115 // Send the default printer to the Web UI. 111 // Sends the default printer to the Web UI.
116 void SendDefaultPrinter(const base::StringValue& default_printer, 112 void SendDefaultPrinter(const base::StringValue& default_printer,
117 const base::StringValue& cloud_print_data); 113 const base::StringValue& cloud_print_data);
118 114
119 // Send the list of printers to the Web UI. 115 // Send the list of printers to the Web UI.
120 void SetupPrinterList(const base::ListValue& printers); 116 void SetupPrinterList(const base::ListValue& printers);
121 117
122 // Send whether cloud print integration should be enabled. 118 // Send whether cloud print integration should be enabled.
123 void SendCloudPrintEnabled(); 119 void SendCloudPrintEnabled();
124 120
125 // Send the PDF data to the cloud to print. 121 // Send the PDF data to the cloud to print.
126 void SendCloudPrintJob(const base::DictionaryValue& settings, 122 void SendCloudPrintJob(const base::DictionaryValue& settings,
127 std::string print_ticket); 123 std::string print_ticket);
128 124
129 // Helper function to get the initiator tab for the print preview tab. 125 // Gets the initiator tab for the print preview tab.
130 TabContents* GetInitiatorTab(); 126 TabContents* GetInitiatorTab();
131 127
132 // Helper function to close the print preview tab. 128 // Closes the print preview tab.
133 void ClosePrintPreviewTab(); 129 void ClosePrintPreviewTab();
134 130
135 // Helper function to activate the initiator tab and close the preview tab. 131 // Activates the initiator tab and close the preview tab.
136 void ActivateInitiatorTabAndClosePreviewTab(); 132 void ActivateInitiatorTabAndClosePreviewTab();
137 133
138 // Adds all the recorded stats taken so far to histogram counts. 134 // Adds all the recorded stats taken so far to histogram counts.
139 void ReportStats(); 135 void ReportStats();
140 136
141 // Helper function to hide the preview tab for printing. 137 // Hides the preview tab for printing.
142 void HidePreviewTab(); 138 void HidePreviewTab();
143 139
144 // Helper function to clear initiator tab details for this preview tab. 140 // Clears initiator tab details for this preview tab.
145 void ClearInitiatorTabDetails(); 141 void ClearInitiatorTabDetails();
146 142
147 // Pointer to current print system. 143 // Pointer to current print system.
148 scoped_refptr<printing::PrintBackend> print_backend_; 144 scoped_refptr<printing::PrintBackend> print_backend_;
149 145
150 // The underlying dialog object. 146 // The underlying dialog object.
151 scoped_refptr<SelectFileDialog> select_file_dialog_; 147 scoped_refptr<SelectFileDialog> select_file_dialog_;
152 148
153 static FilePath* last_saved_path_; 149 static FilePath* last_saved_path_;
154 static std::string* last_used_printer_cloud_print_data_; 150 static std::string* last_used_printer_cloud_print_data_;
(...skipping 10 matching lines...) Expand all
165 // Whether we have already logged a failed print preview. 161 // Whether we have already logged a failed print preview.
166 bool reported_failed_preview_; 162 bool reported_failed_preview_;
167 163
168 // Whether we have already logged the number of printers this session. 164 // Whether we have already logged the number of printers this session.
169 bool has_logged_printers_count_; 165 bool has_logged_printers_count_;
170 166
171 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); 167 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler);
172 }; 168 };
173 169
174 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ 170 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_preview_message_handler.cc ('k') | chrome/browser/ui/webui/print_preview_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698