diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-10 05:46:45 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-10 05:46:45 +0000 |
commit | dd7daa80d25deb78ab365e28df4d93437357793b (patch) | |
tree | fb4dd2331820f5e32ddeb7e2bfb731f0604fbc0d /chrome/renderer/print_web_view_helper.cc | |
parent | 64c40aa34646a198a04029ee6b78dd9559595dc5 (diff) | |
download | chromium_src-dd7daa80d25deb78ab365e28df4d93437357793b.zip chromium_src-dd7daa80d25deb78ab365e28df4d93437357793b.tar.gz chromium_src-dd7daa80d25deb78ab365e28df4d93437357793b.tar.bz2 |
Switch to WebFrame from the WebKit API.
I tried to avoid unnecessary changes in this CL to help make it easier to
review.
As part of this CL, glue/webtextinput* are folded into WebFrame / WebFrameImpl.
R=dglazkov
BUG=10034
TEST=none
Review URL: http://codereview.chromium.org/164225
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper.cc')
-rw-r--r-- | chrome/renderer/print_web_view_helper.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc index a0803ba..3d4a336 100644 --- a/chrome/renderer/print_web_view_helper.cc +++ b/chrome/renderer/print_web_view_helper.cc @@ -10,12 +10,13 @@ #include "chrome/renderer/render_view.h" #include "grit/generated_resources.h" #include "printing/units.h" +#include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebRect.h" #include "webkit/api/public/WebScreenInfo.h" #include "webkit/api/public/WebSize.h" #include "webkit/api/public/WebURLRequest.h" -#include "webkit/glue/webframe.h" +using WebKit::WebFrame; using WebKit::WebRect; using WebKit::WebScreenInfo; using WebKit::WebString; @@ -50,11 +51,11 @@ PrepareFrameAndViewForPrint::PrepareFrameAndViewForPrint( web_view->resize(print_layout_size); - expected_pages_count_ = frame->PrintBegin(print_canvas_size_); + expected_pages_count_ = frame->printBegin(print_canvas_size_); } PrepareFrameAndViewForPrint::~PrepareFrameAndViewForPrint() { - frame_->PrintEnd(); + frame_->printEnd(); web_view_->resize(prev_view_size_); } @@ -88,7 +89,7 @@ bool PrintWebViewHelper::CopyAndPrint(const ViewMsg_PrintPages_Params& params, // Create a new WebView with the same settings as the current display one. // Except that we disable javascript (don't want any active content running // on the page). - WebPreferences prefs = web_frame->GetView()->GetPreferences(); + WebPreferences prefs = web_frame->view()->GetPreferences(); prefs.javascript_enabled = false; prefs.java_enabled = false; print_web_view_.reset(WebView::Create(this, prefs)); @@ -96,14 +97,14 @@ bool PrintWebViewHelper::CopyAndPrint(const ViewMsg_PrintPages_Params& params, print_pages_params_.reset(new ViewMsg_PrintPages_Params(params)); print_pages_params_->pages.clear(); // Print all pages of selection. - std::string html = web_frame->GetSelection(true); + std::string html = web_frame->selectionAsMarkup().utf8(); std::string url_str = "data:text/html;charset=utf-8,"; url_str.append(html); GURL url(url_str); // When loading is done this will call DidStopLoading that will do the // actual printing. - print_web_view_->GetMainFrame()->LoadRequest(WebURLRequest(url)); + print_web_view_->GetMainFrame()->loadRequest(WebURLRequest(url)); return true; } @@ -112,7 +113,7 @@ void PrintWebViewHelper::PrintPages(const ViewMsg_PrintPages_Params& params, WebFrame* frame) { PrepareFrameAndViewForPrint prep_frame_view(params.params, frame, - frame->GetView()); + frame->view()); int page_count = prep_frame_view.GetExpectedPageCount(); Send(new ViewHostMsg_DidGetPrintedPagesCount(routing_id(), |