Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/renderer/printing/print_web_view_helper.cc

Issue 800343004: OOP PDF: Fix PrintWebViewHelper test issues with OOP PDF enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 897
898 blink::WebDocument document = main_frame->document(); 898 blink::WebDocument document = main_frame->document();
899 // <object>/<iframe> with id="pdf-viewer" is created in 899 // <object>/<iframe> with id="pdf-viewer" is created in
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. In tests, there
908 // may not be an iframe containing the out-of-process plugin, so continue with
909 // the element with ID "pdf-viewer" if it isn't an iframe.
908 blink::WebLocalFrame* plugin_frame = pdf_element.document().frame(); 910 blink::WebLocalFrame* plugin_frame = pdf_element.document().frame();
909 blink::WebElement plugin_element = pdf_element; 911 blink::WebElement plugin_element = pdf_element;
910 if (switches::OutOfProcessPdfEnabled()) { 912 if (switches::OutOfProcessPdfEnabled() &&
911 if (!pdf_element.hasHTMLTagName("iframe")) { 913 pdf_element.hasHTMLTagName("iframe")) {
912 NOTREACHED();
913 return;
914 }
915 plugin_frame = blink::WebLocalFrame::fromFrameOwnerElement(pdf_element); 914 plugin_frame = blink::WebLocalFrame::fromFrameOwnerElement(pdf_element);
916 plugin_element = GetPdfElement(plugin_frame); 915 plugin_element = GetPdfElement(plugin_frame);
917 if (plugin_element.isNull()) { 916 if (plugin_element.isNull()) {
918 NOTREACHED(); 917 NOTREACHED();
919 return; 918 return;
920 } 919 }
921 } 920 }
922 921
923 // Set |print_for_preview_| flag and autoreset it to back to original 922 // Set |print_for_preview_| flag and autoreset it to back to original
924 // on return. 923 // on return.
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 blink::WebConsoleMessage::LevelWarning, message)); 2054 blink::WebConsoleMessage::LevelWarning, message));
2056 return false; 2055 return false;
2057 } 2056 }
2058 2057
2059 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2058 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2060 // Reset counter on successful print. 2059 // Reset counter on successful print.
2061 count_ = 0; 2060 count_ = 0;
2062 } 2061 }
2063 2062
2064 } // namespace printing 2063 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698