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

Unified Diff: chrome/renderer/print_web_view_helper.h

Issue 7993005: Reuse PrintContext to excessively triggering matchMedia('print') listeners. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Adds a unit test and updates DPI on change. Created 9 years, 2 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
Index: chrome/renderer/print_web_view_helper.h
diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h
index d7bb3be941c0002d29ac3341734db0d22653b9a3..641b26e22cb00d585ad44000fd54b6dacd462868 100644
--- a/chrome/renderer/print_web_view_helper.h
+++ b/chrome/renderer/print_web_view_helper.h
@@ -56,9 +56,7 @@ class PrepareFrameAndViewForPrint {
return expected_pages_count_;
}
- bool ShouldUseBrowserOverlays() const {
- return use_browser_overlays_;
- }
+ bool ShouldUseBrowserOverlays() const;
const gfx::Size& GetPrintCanvasSize() const {
return print_canvas_size_;
@@ -67,17 +65,15 @@ class PrepareFrameAndViewForPrint {
void FinishPrinting();
private:
- void StartPrinting(const gfx::Size& print_params);
+ void StartPrinting(const gfx::Size& print_params, int dpi);
WebKit::WebFrame* frame_;
- WebKit::WebNode node_to_print_;
WebKit::WebView* web_view_;
gfx::Size print_canvas_size_;
gfx::Size prev_view_size_;
gfx::Size prev_scroll_offset_;
int dpi_;
int expected_pages_count_;
- bool use_browser_overlays_;
bool finished_;
DISALLOW_COPY_AND_ASSIGN(PrepareFrameAndViewForPrint);
@@ -104,6 +100,7 @@ class PrintWebViewHelper
FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest,
BlockScriptInitiatedPrinting);
FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, OnPrintPages);
+ FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, PrintWithMediaQuery);
#if defined(OS_WIN) || defined(OS_MACOSX)
FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, PrintLayoutTest);
« no previous file with comments | « no previous file | chrome/renderer/print_web_view_helper.cc » ('j') | chrome/renderer/print_web_view_helper_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698