| 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 "chrome/renderer/printing/print_web_view_helper.h" | 5 #include "chrome/renderer/printing/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 // chrome/browser/resources/print_preview/print_preview.js | 900 // chrome/browser/resources/print_preview/print_preview.js |
| 901 blink::WebElement pdf_element = document.getElementById("pdf-viewer"); | 901 blink::WebElement pdf_element = document.getElementById("pdf-viewer"); |
| 902 if (pdf_element.isNull()) { | 902 if (pdf_element.isNull()) { |
| 903 NOTREACHED(); | 903 NOTREACHED(); |
| 904 return; | 904 return; |
| 905 } | 905 } |
| 906 | 906 |
| 907 // The out-of-process plugin element is nested within a frame. | 907 // The out-of-process plugin element is nested within a frame. |
| 908 blink::WebLocalFrame* plugin_frame = pdf_element.document().frame(); | 908 blink::WebLocalFrame* plugin_frame = pdf_element.document().frame(); |
| 909 blink::WebElement plugin_element = pdf_element; | 909 blink::WebElement plugin_element = pdf_element; |
| 910 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kOutOfProcessPdf)) { | 910 if (switches::OutOfProcessPdfEnabled()) { |
| 911 if (!pdf_element.hasHTMLTagName("iframe")) { | 911 if (!pdf_element.hasHTMLTagName("iframe")) { |
| 912 NOTREACHED(); | 912 NOTREACHED(); |
| 913 return; | 913 return; |
| 914 } | 914 } |
| 915 plugin_frame = blink::WebLocalFrame::fromFrameOwnerElement(pdf_element); | 915 plugin_frame = blink::WebLocalFrame::fromFrameOwnerElement(pdf_element); |
| 916 plugin_element = GetPdfElement(plugin_frame); | 916 plugin_element = GetPdfElement(plugin_frame); |
| 917 if (plugin_element.isNull()) { | 917 if (plugin_element.isNull()) { |
| 918 NOTREACHED(); | 918 NOTREACHED(); |
| 919 return; | 919 return; |
| 920 } | 920 } |
| (...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2055 blink::WebConsoleMessage::LevelWarning, message)); | 2055 blink::WebConsoleMessage::LevelWarning, message)); |
| 2056 return false; | 2056 return false; |
| 2057 } | 2057 } |
| 2058 | 2058 |
| 2059 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2059 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
| 2060 // Reset counter on successful print. | 2060 // Reset counter on successful print. |
| 2061 count_ = 0; | 2061 count_ = 0; |
| 2062 } | 2062 } |
| 2063 | 2063 |
| 2064 } // namespace printing | 2064 } // namespace printing |
| OLD | NEW |