| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 // Called when the user press ctrl+shift+p to display the native system | 71 // Called when the user press ctrl+shift+p to display the native system |
| 72 // dialog. | 72 // dialog. |
| 73 void ShowSystemDialog(); | 73 void ShowSystemDialog(); |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 friend class PrintPreviewHandlerTest; | 76 friend class PrintPreviewHandlerTest; |
| 77 // TODO(abodenha@chromium.org) See http://crbug.com/136843 | 77 // TODO(abodenha@chromium.org) See http://crbug.com/136843 |
| 78 // PrintSystemTaskProxy should not need to be a friend. | 78 // PrintSystemTaskProxy should not need to be a friend. |
| 79 friend class PrintSystemTaskProxy; | 79 friend class PrintSystemTaskProxy; |
| 80 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsCustom); | |
| 81 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsDefault); | |
| 82 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, | |
| 83 StickyMarginsCustomThenDefault); | |
| 84 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, | |
| 85 GetLastUsedMarginSettingsCustom); | |
| 86 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, | |
| 87 GetLastUsedMarginSettingsDefault); | |
| 88 | 80 |
| 89 TabContents* preview_tab_contents() const; | 81 TabContents* preview_tab_contents() const; |
| 90 content::WebContents* preview_web_contents() const; | 82 content::WebContents* preview_web_contents() const; |
| 91 | 83 |
| 92 // Gets the list of printers. |args| is unused. | 84 // Gets the list of printers. |args| is unused. |
| 93 void HandleGetPrinters(const base::ListValue* args); | 85 void HandleGetPrinters(const base::ListValue* args); |
| 94 | 86 |
| 95 // Asks the initiator renderer to generate a preview. First element of |args| | 87 // Asks the initiator renderer to generate a preview. First element of |args| |
| 96 // is a job settings JSON string. | 88 // is a job settings JSON string. |
| 97 void HandleGetPreview(const base::ListValue* args); | 89 void HandleGetPreview(const base::ListValue* args); |
| 98 | 90 |
| 99 // Gets the job settings from Web UI and initiate printing. First element of | 91 // Gets the job settings from Web UI and initiate printing. First element of |
| 100 // |args| is a job settings JSON string. | 92 // |args| is a job settings JSON string. |
| 101 void HandlePrint(const base::ListValue* args); | 93 void HandlePrint(const base::ListValue* args); |
| 102 | 94 |
| 103 // Handles printing to PDF. |settings| points to a dictionary containing all | 95 // Handles printing to PDF. |settings| points to a dictionary containing all |
| 104 // the print request parameters. | 96 // the print request parameters. |
| 105 void HandlePrintToPdf(const base::DictionaryValue& settings); | 97 void HandlePrintToPdf(const base::DictionaryValue& settings); |
| 106 | 98 |
| 107 // Handles the request to hide the preview tab for printing. |args| is unused. | 99 // Handles the request to hide the preview tab for printing. |args| is unused. |
| 108 void HandleHidePreview(const base::ListValue* args); | 100 void HandleHidePreview(const base::ListValue* args); |
| 109 | 101 |
| 110 // Handles the request to cancel the pending print request. |args| is unused. | 102 // Handles the request to cancel the pending print request. |args| is unused. |
| 111 void HandleCancelPendingPrintRequest(const base::ListValue* args); | 103 void HandleCancelPendingPrintRequest(const base::ListValue* args); |
| 112 | 104 |
| 113 // Handles a request to back up data about the last used cloud print | 105 // Handles a request to store data that the web ui wishes to persist. |
| 114 // printer. | 106 // First element of |args| is the data to persist. |
| 115 // First element of |args| is the printer name. | 107 void HandleSaveAppState(const base::ListValue* args); |
| 116 // Second element of |args| is the current cloud print data JSON. | |
| 117 void HandleSaveLastPrinter(const base::ListValue* args); | |
| 118 | 108 |
| 119 // Gets the printer capabilities. First element of |args| is the printer name. | 109 // Gets the printer capabilities. First element of |args| is the printer name. |
| 120 void HandleGetPrinterCapabilities(const base::ListValue* args); | 110 void HandleGetPrinterCapabilities(const base::ListValue* args); |
| 121 | 111 |
| 122 // Asks the initiator renderer to show the native print system dialog. |args| | 112 // Asks the initiator renderer to show the native print system dialog. |args| |
| 123 // is unused. | 113 // is unused. |
| 124 void HandleShowSystemDialog(const base::ListValue* args); | 114 void HandleShowSystemDialog(const base::ListValue* args); |
| 125 | 115 |
| 126 // Callback for the signin dialog to call once signin is complete. | 116 // Callback for the signin dialog to call once signin is complete. |
| 127 static void OnSigninComplete( | 117 static void OnSigninComplete( |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 bool has_logged_printers_count_; | 206 bool has_logged_printers_count_; |
| 217 | 207 |
| 218 // Holds the path to the print to pdf request. It is empty if no such request | 208 // Holds the path to the print to pdf request. It is empty if no such request |
| 219 // exists. | 209 // exists. |
| 220 scoped_ptr<FilePath> print_to_pdf_path_; | 210 scoped_ptr<FilePath> print_to_pdf_path_; |
| 221 | 211 |
| 222 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 212 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
| 223 }; | 213 }; |
| 224 | 214 |
| 225 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 215 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
| OLD | NEW |