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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 10096001: Remove support for bitmap printing in pepper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ppapi/api/dev/ppp_printing_dev.idl » ('j') | ppapi/api/dev/ppp_printing_dev.idl » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper.cc
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index 3f84f713057d70e6c4c5dc7887ed11f9dd5809b9..31327042598a9765a18784319c93448593db49b3 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -30,6 +30,8 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRequest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLResponse.h"
@@ -69,6 +71,8 @@ using WebKit::WebDocument;
using WebKit::WebElement;
using WebKit::WebFrame;
using WebKit::WebNode;
+using WebKit::WebPlugin;
+using WebKit::WebPluginDocument;
using WebKit::WebSize;
using WebKit::WebString;
using WebKit::WebURLRequest;
@@ -308,8 +312,10 @@ void CalculatePrintCanvasSize(const PrintMsg_Print_Params& print_params,
bool PrintingNodeOrPdfFrame(const WebFrame* frame, const WebNode& node) {
if (!node.isNull())
return true;
- std::string mime(frame->dataSource()->response().mimeType().utf8());
- return mime == "application/pdf";
+ if (!frame->document().isPluginDocument())
+ return false;
+ WebPlugin* plugin = frame->document().to<WebPluginDocument>().plugin();
+ return plugin && plugin->supportsPaginatedPrint();
}
bool PrintingFrameHasPageSizeStyle(WebFrame* frame, int total_page_count) {
« no previous file with comments | « no previous file | ppapi/api/dev/ppp_printing_dev.idl » ('j') | ppapi/api/dev/ppp_printing_dev.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698