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 #include "components/printing/renderer/print_web_view_helper.h" | 5 #include "components/printing/renderer/print_web_view_helper.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 params.cookie = print_pages_params_->params.document_cookie; | 1697 params.cookie = print_pages_params_->params.document_cookie; |
1698 params.has_selection = frame->hasSelection(); | 1698 params.has_selection = frame->hasSelection(); |
1699 params.expected_pages_count = expected_pages_count; | 1699 params.expected_pages_count = expected_pages_count; |
1700 MarginType margin_type = DEFAULT_MARGINS; | 1700 MarginType margin_type = DEFAULT_MARGINS; |
1701 if (PrintingNodeOrPdfFrame(frame, node)) { | 1701 if (PrintingNodeOrPdfFrame(frame, node)) { |
1702 margin_type = | 1702 margin_type = |
1703 GetMarginsForPdf(frame, node, print_pages_params_->params); | 1703 GetMarginsForPdf(frame, node, print_pages_params_->params); |
1704 } | 1704 } |
1705 params.margin_type = margin_type; | 1705 params.margin_type = margin_type; |
1706 params.is_scripted = is_scripted; | 1706 params.is_scripted = is_scripted; |
| 1707 params.is_modifiable = !PrintingNodeOrPdfFrame(frame, node); |
1707 | 1708 |
1708 Send(new PrintHostMsg_DidShowPrintDialog(routing_id())); | 1709 Send(new PrintHostMsg_DidShowPrintDialog(routing_id())); |
1709 | 1710 |
1710 // PrintHostMsg_ScriptedPrint will reset print_scaling_option, so we save the | 1711 // PrintHostMsg_ScriptedPrint will reset print_scaling_option, so we save the |
1711 // value before and restore it afterwards. | 1712 // value before and restore it afterwards. |
1712 blink::WebPrintScalingOption scaling_option = | 1713 blink::WebPrintScalingOption scaling_option = |
1713 print_pages_params_->params.print_scaling_option; | 1714 print_pages_params_->params.print_scaling_option; |
1714 | 1715 |
1715 print_pages_params_.reset(); | 1716 print_pages_params_.reset(); |
1716 IPC::SyncMessage* msg = | 1717 IPC::SyncMessage* msg = |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2252 blink::WebConsoleMessage::LevelWarning, message)); | 2253 blink::WebConsoleMessage::LevelWarning, message)); |
2253 return false; | 2254 return false; |
2254 } | 2255 } |
2255 | 2256 |
2256 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2257 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
2257 // Reset counter on successful print. | 2258 // Reset counter on successful print. |
2258 count_ = 0; | 2259 count_ = 0; |
2259 } | 2260 } |
2260 | 2261 |
2261 } // namespace printing | 2262 } // namespace printing |
OLD | NEW |