diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 17:27:45 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 17:27:45 +0000 |
commit | 16cd533f95ab1d2046f64bb6a18df634f62bda80 (patch) | |
tree | 8b16d305f56f4bec542ffc1103fe31d776555db1 /chrome | |
parent | 28ac70d17d634c99a14b6707d88cd8506a5d27f6 (diff) | |
download | chromium_src-16cd533f95ab1d2046f64bb6a18df634f62bda80.zip chromium_src-16cd533f95ab1d2046f64bb6a18df634f62bda80.tar.gz chromium_src-16cd533f95ab1d2046f64bb6a18df634f62bda80.tar.bz2 |
Fix Print Selection.
(And re-enable it on Windows; other platforms need more work.)
BUG=22937,27621
TEST=Go to a suitable web page; select something; Ctrl-P to print; select "Selection" under "Page Range"; print; etc.
Review URL: http://codereview.chromium.org/1992017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/print_web_view_helper.cc | 7 | ||||
-rw-r--r-- | chrome/renderer/print_web_view_helper.h | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc index d0ad4db..40fe523 100644 --- a/chrome/renderer/print_web_view_helper.cc +++ b/chrome/renderer/print_web_view_helper.cc @@ -153,10 +153,7 @@ void PrintWebViewHelper::Print(WebFrame* frame, bool script_initiated) { // of this message has to deal with this. params.host_window_id = render_view_->host_window(); params.cookie = default_settings.document_cookie; - // TODO(maruel): Reenable once http://crbug.com/22937 is fixed. - // Print selection is broken because DidStopLoading is never called. - // params.has_selection = frame->hasSelection(); - params.has_selection = false; + params.has_selection = frame->hasSelection(); params.expected_pages_count = expected_pages_count; params.use_overlays = use_browser_overlays; @@ -240,7 +237,7 @@ bool PrintWebViewHelper::CopyAndPrint(const ViewMsg_PrintPages_Params& params, print_web_view_ = WebView::create(this); prefs.Apply(print_web_view_); - print_web_view_->initializeMainFrame(NULL); + print_web_view_->initializeMainFrame(this); print_pages_params_.reset(new ViewMsg_PrintPages_Params(params)); print_pages_params_->pages.clear(); // Print all pages of selection. diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h index f80c507..0c971b5 100644 --- a/chrome/renderer/print_web_view_helper.h +++ b/chrome/renderer/print_web_view_helper.h @@ -10,6 +10,7 @@ #include "base/scoped_ptr.h" #include "base/time.h" #include "gfx/size.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h" namespace gfx { @@ -70,7 +71,8 @@ class PrepareFrameAndViewForPrint { // PrintWebViewHelper handles most of the printing grunt work for RenderView. // We plan on making print asynchronous and that will require copying the DOM // of the document and creating a new WebView with the contents. -class PrintWebViewHelper : public WebKit::WebViewClient { +class PrintWebViewHelper : public WebKit::WebViewClient, + public WebKit::WebFrameClient { public: explicit PrintWebViewHelper(RenderView* render_view); virtual ~PrintWebViewHelper(); |