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

Side by Side Diff: chrome/renderer/pepper/chrome_pdf_print_client.cc

Issue 505243003: pdf: Move PepperPDFHost into the pdf component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pdf-component
Patch Set: tot-merge Created 6 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/pepper/chrome_pdf_print_client.h" 5 #include "chrome/renderer/pepper/chrome_pdf_print_client.h"
6 6
7 #include "chrome/renderer/printing/print_web_view_helper.h" 7 #include "chrome/renderer/printing/print_web_view_helper.h"
8 #include "content/public/renderer/pepper_plugin_instance.h" 8 #include "content/public/renderer/pepper_plugin_instance.h"
9 #include "content/public/renderer/render_view.h" 9 #include "content/public/renderer/render_view.h"
10 #include "third_party/WebKit/public/web/WebDocument.h" 10 #include "third_party/WebKit/public/web/WebDocument.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 ChromePDFPrintClient::~ChromePDFPrintClient() { 38 ChromePDFPrintClient::~ChromePDFPrintClient() {
39 } 39 }
40 40
41 bool ChromePDFPrintClient::IsPrintingEnabled(PP_Instance instance_id) { 41 bool ChromePDFPrintClient::IsPrintingEnabled(PP_Instance instance_id) {
42 blink::WebElement element = GetWebElement(instance_id); 42 blink::WebElement element = GetWebElement(instance_id);
43 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element); 43 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element);
44 return helper && helper->IsPrintingEnabled(); 44 return helper && helper->IsPrintingEnabled();
45 } 45 }
46 46
47 void ChromePDFPrintClient::Print(PP_Instance instance_id) { 47 bool ChromePDFPrintClient::Print(PP_Instance instance_id) {
48 blink::WebElement element = GetWebElement(instance_id); 48 blink::WebElement element = GetWebElement(instance_id);
49 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element); 49 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element);
50 if (helper) 50 if (helper) {
51 helper->PrintNode(element); 51 helper->PrintNode(element);
52 return true;
53 }
54 return false;
52 } 55 }
OLDNEW
« no previous file with comments | « chrome/renderer/pepper/chrome_pdf_print_client.h ('k') | chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698