Index: android_webview/renderer/print_web_view_helper.cc |
diff --git a/android_webview/renderer/print_web_view_helper.cc b/android_webview/renderer/print_web_view_helper.cc |
index 006a37107d3e18f90e9e2f5a21b0c5950a93baf7..2f135822a7bbf99ff815bf92281198c4c7aea583 100644 |
--- a/android_webview/renderer/print_web_view_helper.cc |
+++ b/android_webview/renderer/print_web_view_helper.cc |
@@ -19,9 +19,9 @@ |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/stringprintf.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "content/public/common/web_preferences.h" |
#include "content/public/renderer/render_thread.h" |
#include "content/public/renderer/render_view.h" |
-#include "content/public/renderer/web_preferences.h" |
#include "net/base/escape.h" |
#include "printing/metafile.h" |
#include "printing/metafile_impl.h" |
@@ -44,13 +44,14 @@ |
#include "third_party/WebKit/public/web/WebViewClient.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/base/resource/resource_bundle.h" |
-#include "webkit/common/webpreferences.h" |
// This code is copied from chrome/renderer/printing. Code is slightly |
// modified to run it with webview, and the modifications are marked |
// using OS_ANDROID. |
// TODO(sgurun): remove the code as part of componentization of printing. |
+using content::WebPreferences; |
+ |
namespace printing { |
namespace { |
@@ -665,12 +666,13 @@ void PrepareFrameAndViewForPrint::CopySelection( |
blink::WebView* web_view = blink::WebView::create(this); |
owns_web_view_ = true; |
- content::ApplyWebPreferences(prefs, web_view); |
- |
web_view->setMainFrame(blink::WebLocalFrame::create(this)); |
frame_.Reset(web_view->mainFrame()->toWebLocalFrame()); |
node_to_print_.reset(); |
+ content::RenderView::FromWebView(frame_.GetFrame()->view()) |
+ ->ApplyWebPreferences(prefs); |
boliu
2014/07/03 16:49:32
Ohh, now I understand. Printing is creating its ow
tfarina
2014/07/03 17:25:34
OK.
That is a design decision.
John, what is you
|
+ |
// When loading is done this will call didStopLoading() and that will do the |
// actual printing. |
frame()->loadRequest(blink::WebURLRequest(GURL(url_str))); |
@@ -1590,9 +1592,8 @@ bool PrintWebViewHelper::RenderPagesForPrint(blink::WebLocalFrame* frame, |
return false; |
const PrintMsg_PrintPages_Params& params = *print_pages_params_; |
const PrintMsg_Print_Params& print_params = params.params; |
- prep_frame_view_.reset( |
- new PrepareFrameAndViewForPrint(print_params, frame, node, |
- ignore_css_margins_)); |
+ prep_frame_view_.reset(new PrepareFrameAndViewForPrint( |
+ print_params, frame, node, ignore_css_margins_)); |
DCHECK(!print_pages_params_->params.selection_only || |
print_pages_params_->pages.empty()); |
prep_frame_view_->CopySelectionIfNeeded( |