| 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_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
| 6 #define CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 6 #define CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 // Finalize the print ready preview document. | 163 // Finalize the print ready preview document. |
| 164 bool FinalizePrintReadyDocument(); | 164 bool FinalizePrintReadyDocument(); |
| 165 | 165 |
| 166 // Enable/Disable window.print calls. If |blocked| is true window.print | 166 // Enable/Disable window.print calls. If |blocked| is true window.print |
| 167 // calls will silently fail. Call with |blocked| set to false to reenable. | 167 // calls will silently fail. Call with |blocked| set to false to reenable. |
| 168 void SetScriptedPrintBlocked(bool blocked); | 168 void SetScriptedPrintBlocked(bool blocked); |
| 169 | 169 |
| 170 // Main printing code ------------------------------------------------------- | 170 // Main printing code ------------------------------------------------------- |
| 171 | 171 |
| 172 void Print(blink::WebLocalFrame* frame, const blink::WebNode& node); | 172 void Print(blink::WebLocalFrame* frame, |
| 173 const blink::WebNode& node, |
| 174 bool is_scripted); |
| 173 | 175 |
| 174 // Notification when printing is done - signal tear-down/free resources. | 176 // Notification when printing is done - signal tear-down/free resources. |
| 175 void DidFinishPrinting(PrintingResult result); | 177 void DidFinishPrinting(PrintingResult result); |
| 176 | 178 |
| 177 // Print Settings ----------------------------------------------------------- | 179 // Print Settings ----------------------------------------------------------- |
| 178 | 180 |
| 179 // Initialize print page settings with default settings. | 181 // Initialize print page settings with default settings. |
| 180 // Used only for native printing workflow. | 182 // Used only for native printing workflow. |
| 181 bool InitPrintSettings(bool fit_to_paper_size); | 183 bool InitPrintSettings(bool fit_to_paper_size); |
| 182 | 184 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 193 // |passed_job_settings| dictionary contains print job details such as printer | 195 // |passed_job_settings| dictionary contains print job details such as printer |
| 194 // name, number of copies, page range, etc. | 196 // name, number of copies, page range, etc. |
| 195 bool UpdatePrintSettings(blink::WebLocalFrame* frame, | 197 bool UpdatePrintSettings(blink::WebLocalFrame* frame, |
| 196 const blink::WebNode& node, | 198 const blink::WebNode& node, |
| 197 const base::DictionaryValue& passed_job_settings); | 199 const base::DictionaryValue& passed_job_settings); |
| 198 | 200 |
| 199 // Get final print settings from the user. | 201 // Get final print settings from the user. |
| 200 // Return false if the user cancels or on error. | 202 // Return false if the user cancels or on error. |
| 201 bool GetPrintSettingsFromUser(blink::WebFrame* frame, | 203 bool GetPrintSettingsFromUser(blink::WebFrame* frame, |
| 202 const blink::WebNode& node, | 204 const blink::WebNode& node, |
| 203 int expected_pages_count); | 205 int expected_pages_count, |
| 206 bool is_scripted); |
| 204 | 207 |
| 205 // Page Printing / Rendering ------------------------------------------------ | 208 // Page Printing / Rendering ------------------------------------------------ |
| 206 | 209 |
| 207 void OnFramePreparedForPrintPages(); | 210 void OnFramePreparedForPrintPages(); |
| 208 void PrintPages(); | 211 void PrintPages(); |
| 209 bool PrintPagesNative(blink::WebFrame* frame, int page_count); | 212 bool PrintPagesNative(blink::WebFrame* frame, int page_count); |
| 210 void FinishFramePrinting(); | 213 void FinishFramePrinting(); |
| 211 | 214 |
| 212 // Prints the page listed in |params|. | 215 // Prints the page listed in |params|. |
| 213 #if defined(OS_LINUX) || defined(OS_ANDROID) | 216 #if defined(OS_LINUX) || defined(OS_ANDROID) |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 base::Closure on_stop_loading_closure_; | 465 base::Closure on_stop_loading_closure_; |
| 463 | 466 |
| 464 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; | 467 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; |
| 465 | 468 |
| 466 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 469 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 467 }; | 470 }; |
| 468 | 471 |
| 469 } // namespace printing | 472 } // namespace printing |
| 470 | 473 |
| 471 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 474 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |