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

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

Issue 1128453003: Remove the OOP PDF flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chrome_print_web_view_helper_delegate.h" 5 #include "chrome/renderer/printing/chrome_print_web_view_helper_delegate.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 auto plugin_element = frame->document().getElementById("plugin"); 48 auto plugin_element = frame->document().getElementById("plugin");
49 if (!plugin_element.isNull()) { 49 if (!plugin_element.isNull()) {
50 return plugin_element; 50 return plugin_element;
51 } 51 }
52 NOTREACHED(); 52 NOTREACHED();
53 } 53 }
54 #endif // defined(ENABLE_EXTENSIONS) 54 #endif // defined(ENABLE_EXTENSIONS)
55 return blink::WebElement(); 55 return blink::WebElement();
56 } 56 }
57 57
58 bool ChromePrintWebViewHelperDelegate::IsOutOfProcessPdfEnabled() {
59 return switches::OutOfProcessPdfEnabled();
60 }
61
62 bool ChromePrintWebViewHelperDelegate::IsPrintPreviewEnabled() { 58 bool ChromePrintWebViewHelperDelegate::IsPrintPreviewEnabled() {
63 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 59 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
64 return !command_line->HasSwitch(switches::kDisablePrintPreview); 60 return !command_line->HasSwitch(switches::kDisablePrintPreview);
65 } 61 }
66 62
67 bool ChromePrintWebViewHelperDelegate::OverridePrint( 63 bool ChromePrintWebViewHelperDelegate::OverridePrint(
68 blink::WebLocalFrame* frame) { 64 blink::WebLocalFrame* frame) {
69 #if defined(ENABLE_EXTENSIONS) 65 #if defined(ENABLE_EXTENSIONS)
70 if (!frame->document().isPluginDocument()) 66 if (!frame->document().isPluginDocument())
71 return false; 67 return false;
72 68
73 std::vector<extensions::MimeHandlerViewContainer*> mime_handlers = 69 std::vector<extensions::MimeHandlerViewContainer*> mime_handlers =
74 extensions::MimeHandlerViewContainer::FromRenderFrame( 70 extensions::MimeHandlerViewContainer::FromRenderFrame(
75 content::RenderFrame::FromWebFrame(frame)); 71 content::RenderFrame::FromWebFrame(frame));
76 if (!mime_handlers.empty()) { 72 if (!mime_handlers.empty()) {
77 // This message is handled in chrome/browser/resources/pdf/pdf.js and 73 // This message is handled in chrome/browser/resources/pdf/pdf.js and
78 // instructs the PDF plugin to print. This is to make window.print() on a 74 // instructs the PDF plugin to print. This is to make window.print() on a
79 // PDF plugin document correctly print the PDF. See 75 // PDF plugin document correctly print the PDF. See
80 // https://crbug.com/448720. 76 // https://crbug.com/448720.
81 base::DictionaryValue message; 77 base::DictionaryValue message;
82 message.SetString("type", "print"); 78 message.SetString("type", "print");
83 mime_handlers.front()->PostMessageFromValue(message); 79 mime_handlers.front()->PostMessageFromValue(message);
84 return true; 80 return true;
85 } 81 }
86 #endif // defined(ENABLE_EXTENSIONS) 82 #endif // defined(ENABLE_EXTENSIONS)
87 return false; 83 return false;
88 } 84 }
OLDNEW
« no previous file with comments | « chrome/renderer/printing/chrome_print_web_view_helper_delegate.h ('k') | components/printing/renderer/print_web_view_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698