| 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_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| 6 #define CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 6 #define CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 const printing::PageSizeMargins& page_layout_in_points, | 305 const printing::PageSizeMargins& page_layout_in_points, |
| 306 const base::DictionaryValue& header_footer_info); | 306 const base::DictionaryValue& header_footer_info); |
| 307 | 307 |
| 308 bool GetPrintFrame(WebKit::WebFrame** frame); | 308 bool GetPrintFrame(WebKit::WebFrame** frame); |
| 309 | 309 |
| 310 // This reports the current time - |start_time| as the time to render a page. | 310 // This reports the current time - |start_time| as the time to render a page. |
| 311 void ReportPreviewPageRenderTime(base::TimeTicks start_time); | 311 void ReportPreviewPageRenderTime(base::TimeTicks start_time); |
| 312 | 312 |
| 313 // Script Initiated Printing ------------------------------------------------ | 313 // Script Initiated Printing ------------------------------------------------ |
| 314 | 314 |
| 315 // Return true if script initiated printing is currently allowed. |
| 316 bool IsScriptInitiatedPrintAllowed(WebKit::WebFrame* frame); |
| 317 |
| 315 // Returns true if script initiated printing occurs too often. | 318 // Returns true if script initiated printing occurs too often. |
| 316 bool IsScriptInitiatedPrintTooFrequent(WebKit::WebFrame* frame); | 319 bool IsScriptInitiatedPrintTooFrequent(WebKit::WebFrame* frame); |
| 317 | 320 |
| 318 // Reset the counter for script initiated printing. | 321 // Reset the counter for script initiated printing. |
| 319 // Scripted printing will be allowed to continue. | 322 // Scripted printing will be allowed to continue. |
| 320 void ResetScriptedPrintCount(); | 323 void ResetScriptedPrintCount(); |
| 321 | 324 |
| 322 // Increment the counter for script initiated printing. | 325 // Increment the counter for script initiated printing. |
| 323 // Scripted printing will be blocked for a limited amount of time. | 326 // Scripted printing will be blocked for a limited amount of time. |
| 324 void IncrementScriptedPrintCount(); | 327 void IncrementScriptedPrintCount(); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 | 466 |
| 464 State state_; | 467 State state_; |
| 465 }; | 468 }; |
| 466 | 469 |
| 467 PrintPreviewContext print_preview_context_; | 470 PrintPreviewContext print_preview_context_; |
| 468 | 471 |
| 469 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 472 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 470 }; | 473 }; |
| 471 | 474 |
| 472 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 475 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |