| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/renderer/print_web_view_helper.h" | 5 #include "chrome/renderer/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/gfx/size.h" | 8 #include "base/gfx/size.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| 11 #include "chrome/renderer/render_view.h" | 11 #include "chrome/renderer/render_view.h" |
| 12 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
| 13 #include "printing/native_metafile.h" | 13 #include "printing/native_metafile.h" |
| 14 #include "skia/ext/vector_canvas.h" | 14 #include "skia/ext/vector_canvas.h" |
| 15 #include "webkit/api/public/WebConsoleMessage.h" | 15 #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" |
| 16 #include "webkit/api/public/WebFrame.h" | 16 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 17 | 17 |
| 18 using WebKit::WebConsoleMessage; | 18 using WebKit::WebConsoleMessage; |
| 19 using WebKit::WebFrame; | 19 using WebKit::WebFrame; |
| 20 using WebKit::WebString; | 20 using WebKit::WebString; |
| 21 | 21 |
| 22 void PrintWebViewHelper::Print(WebFrame* frame, bool script_initiated) { | 22 void PrintWebViewHelper::Print(WebFrame* frame, bool script_initiated) { |
| 23 const int kMinSecondsToIgnoreJavascriptInitiatedPrint = 2; | 23 const int kMinSecondsToIgnoreJavascriptInitiatedPrint = 2; |
| 24 const int kMaxSecondsToIgnoreJavascriptInitiatedPrint = 2 * 60; // 2 Minutes. | 24 const int kMaxSecondsToIgnoreJavascriptInitiatedPrint = 2 * 60; // 2 Minutes. |
| 25 | 25 |
| 26 // If still not finished with earlier print request simply ignore. | 26 // If still not finished with earlier print request simply ignore. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 274 } |
| 275 metafile.CloseEmf(); | 275 metafile.CloseEmf(); |
| 276 if (Send(new ViewHostMsg_DuplicateSection( | 276 if (Send(new ViewHostMsg_DuplicateSection( |
| 277 routing_id(), | 277 routing_id(), |
| 278 page_params.metafile_data_handle, | 278 page_params.metafile_data_handle, |
| 279 &page_params.metafile_data_handle))) { | 279 &page_params.metafile_data_handle))) { |
| 280 Send(new ViewHostMsg_DidPrintPage(routing_id(), page_params)); | 280 Send(new ViewHostMsg_DidPrintPage(routing_id(), page_params)); |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 | 283 |
| OLD | NEW |