Chromium Code Reviews| 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( | |
| 317 WebKit::WebFrame* frame); | |
|
Lei Zhang
2012/03/19 20:19:32
nit: this fits on one line.
Albert Bodenhamer
2012/03/19 23:16:17
Done.
| |
| 318 | |
| 315 // Returns true if script initiated printing occurs too often. | 319 // Returns true if script initiated printing occurs too often. |
| 316 bool IsScriptInitiatedPrintTooFrequent(WebKit::WebFrame* frame); | 320 bool IsScriptInitiatedPrintTooFrequent(WebKit::WebFrame* frame); |
| 317 | 321 |
| 318 // Reset the counter for script initiated printing. | 322 // Reset the counter for script initiated printing. |
| 319 // Scripted printing will be allowed to continue. | 323 // Scripted printing will be allowed to continue. |
| 320 void ResetScriptedPrintCount(); | 324 void ResetScriptedPrintCount(); |
| 321 | 325 |
| 322 // Increment the counter for script initiated printing. | 326 // Increment the counter for script initiated printing. |
| 323 // Scripted printing will be blocked for a limited amount of time. | 327 // Scripted printing will be blocked for a limited amount of time. |
| 324 void IncrementScriptedPrintCount(); | 328 void IncrementScriptedPrintCount(); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 463 | 467 |
| 464 State state_; | 468 State state_; |
| 465 }; | 469 }; |
| 466 | 470 |
| 467 PrintPreviewContext print_preview_context_; | 471 PrintPreviewContext print_preview_context_; |
| 468 | 472 |
| 469 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 473 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 470 }; | 474 }; |
| 471 | 475 |
| 472 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 476 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |