diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-23 23:21:21 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-23 23:21:21 +0000 |
commit | 3cce538ea624ae4fcc0e03a5e1b1c9959954a284 (patch) | |
tree | 5c985cbf578dd9786101a602e4e0259c4225ec90 | |
parent | e231975b842e70be98485ef15a26ae3c49150155 (diff) | |
download | chromium_src-3cce538ea624ae4fcc0e03a5e1b1c9959954a284.zip chromium_src-3cce538ea624ae4fcc0e03a5e1b1c9959954a284.tar.gz chromium_src-3cce538ea624ae4fcc0e03a5e1b1c9959954a284.tar.bz2 |
Cleanup: Remove unused has_visible_overlays variable.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7970021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102611 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/printing/print_view_manager.cc | 3 | ||||
-rw-r--r-- | chrome/common/print_messages.h | 3 | ||||
-rw-r--r-- | chrome/renderer/print_web_view_helper_win.cc | 3 | ||||
-rw-r--r-- | printing/printed_document.cc | 6 | ||||
-rw-r--r-- | printing/printed_document.h | 3 | ||||
-rw-r--r-- | printing/printed_page.cc | 6 | ||||
-rw-r--r-- | printing/printed_page.h | 7 | ||||
-rw-r--r-- | printing/printed_page_unittest.cc | 24 |
8 files changed, 16 insertions, 39 deletions
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc index 015b1f3..fe6e78f 100644 --- a/chrome/browser/printing/print_view_manager.cc +++ b/chrome/browser/printing/print_view_manager.cc @@ -236,8 +236,7 @@ void PrintViewManager::OnDidPrintPage( metafile.release(), params.actual_shrink, params.page_size, - params.content_area, - params.has_visible_overlays); + params.content_area); ShouldQuitFromInnerMessageLoop(); } diff --git a/chrome/common/print_messages.h b/chrome/common/print_messages.h index a9b7fe3..a3a56d9 100644 --- a/chrome/common/print_messages.h +++ b/chrome/common/print_messages.h @@ -230,9 +230,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params) // The printable area the page author specified. IPC_STRUCT_MEMBER(gfx::Rect, content_area) - - // True if the page has visible overlays. - IPC_STRUCT_MEMBER(bool, has_visible_overlays) IPC_STRUCT_END() // Parameters for the IPC message ViewHostMsg_ScriptedPrint diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc index a17da2e..4ceef0b 100644 --- a/chrome/renderer/print_web_view_helper_win.cc +++ b/chrome/renderer/print_web_view_helper_win.cc @@ -112,7 +112,6 @@ void PrintWebViewHelper::PrintPageInternal( page_params.content_area = gfx::Rect(params.params.margin_left, params.params.margin_top, params.params.printable_size.width(), params.params.printable_size.height()); - page_params.has_visible_overlays = frame->isPageBoxVisible(page_number); if (!CopyMetafileDataToSharedMem(metafile.get(), &(page_params.metafile_data_handle))) { @@ -148,7 +147,7 @@ bool PrintWebViewHelper::RenderPreviewPage(int page_number) { if (draft_metafile.get()) { draft_metafile->FinishDocument(); } else if (print_preview_context_.IsModifiable() && - print_preview_context_.generate_draft_pages()){ + print_preview_context_.generate_draft_pages()) { DCHECK(!draft_metafile.get()); draft_metafile.reset( print_preview_context_.metafile()->GetMetafileForCurrentPage()); diff --git a/printing/printed_document.cc b/printing/printed_document.cc index 7f2834e..d8edd3a 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc @@ -67,16 +67,14 @@ void PrintedDocument::SetPage(int page_number, Metafile* metafile, double shrink, const gfx::Size& paper_size, - const gfx::Rect& page_rect, - bool has_visible_overlays) { + const gfx::Rect& page_rect) { // Notice the page_number + 1, the reason is that this is the value that will // be shown. Users dislike 0-based counting. scoped_refptr<PrintedPage> page( new PrintedPage(page_number + 1, metafile, paper_size, - page_rect, - has_visible_overlays)); + page_rect)); { base::AutoLock lock(lock_); mutable_.pages_[page_number] = page; diff --git a/printing/printed_document.h b/printing/printed_document.h index 67e7f6d..27577f7 100644 --- a/printing/printed_document.h +++ b/printing/printed_document.h @@ -47,8 +47,7 @@ class PRINTING_EXPORT PrintedDocument // Sets a page's data. 0-based. Takes metafile ownership. // Note: locks for a short amount of time. void SetPage(int page_number, Metafile* metafile, double shrink, - const gfx::Size& paper_size, const gfx::Rect& page_rect, - bool has_visible_overlays); + const gfx::Size& paper_size, const gfx::Rect& page_rect); // Retrieves a page. If the page is not available right now, it // requests to have this page be rendered and returns false. diff --git a/printing/printed_page.cc b/printing/printed_page.cc index ac1a2d8..7701dbd2 100644 --- a/printing/printed_page.cc +++ b/printing/printed_page.cc @@ -9,13 +9,11 @@ namespace printing { PrintedPage::PrintedPage(int page_number, Metafile* metafile, const gfx::Size& page_size, - const gfx::Rect& page_content_rect, - bool has_visible_overlays) + const gfx::Rect& page_content_rect) : page_number_(page_number), metafile_(metafile), page_size_(page_size), - page_content_rect_(page_content_rect), - has_visible_overlays_(has_visible_overlays) { + page_content_rect_(page_content_rect) { } PrintedPage::~PrintedPage() { diff --git a/printing/printed_page.h b/printing/printed_page.h index fc0d3ba..28bf191 100644 --- a/printing/printed_page.h +++ b/printing/printed_page.h @@ -25,15 +25,13 @@ class PRINTING_EXPORT PrintedPage PrintedPage(int page_number, Metafile* metafile, const gfx::Size& page_size, - const gfx::Rect& page_content_rect, - bool has_visible_overlays); + const gfx::Rect& page_content_rect); // Getters int page_number() const { return page_number_; } const Metafile* metafile() const; const gfx::Size& page_size() const { return page_size_; } const gfx::Rect& page_content_rect() const { return page_content_rect_; } - bool has_visible_overlays() const { return has_visible_overlays_; } // Get page content rect adjusted based on // http://dev.w3.org/csswg/css3-page/#positioning-page-box @@ -58,9 +56,6 @@ class PRINTING_EXPORT PrintedPage // The printable area of the page. const gfx::Rect page_content_rect_; - // True if the overlays should be visible in this page. - bool has_visible_overlays_; - DISALLOW_COPY_AND_ASSIGN(PrintedPage); }; diff --git a/printing/printed_page_unittest.cc b/printing/printed_page_unittest.cc index 91b2111..1a33d10 100644 --- a/printing/printed_page_unittest.cc +++ b/printing/printed_page_unittest.cc @@ -1,12 +1,8 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "printing/printed_page.h" - -#include <string> -#include <vector> - #include "testing/gtest/include/gtest/gtest.h" namespace printing { @@ -16,11 +12,10 @@ TEST(PrintedPageTest, GetCenteredPageContentRect) { gfx::Rect page_content; // No centering. - page =new PrintedPage(1, - NULL, - gfx::Size(1200, 1200), - gfx::Rect(0, 0, 400, 1100), - true); + page = new PrintedPage(1, + NULL, + gfx::Size(1200, 1200), + gfx::Rect(0, 0, 400, 1100)); page->GetCenteredPageContentRect(gfx::Size(1000, 1000), &page_content); EXPECT_EQ(0, page_content.x()); EXPECT_EQ(0, page_content.y()); @@ -31,8 +26,7 @@ TEST(PrintedPageTest, GetCenteredPageContentRect) { page = new PrintedPage(1, NULL, gfx::Size(500, 1200), - gfx::Rect(0, 0, 400, 1100), - true); + gfx::Rect(0, 0, 400, 1100)); page->GetCenteredPageContentRect(gfx::Size(1000, 1000), &page_content); EXPECT_EQ(250, page_content.x()); EXPECT_EQ(0, page_content.y()); @@ -43,8 +37,7 @@ TEST(PrintedPageTest, GetCenteredPageContentRect) { page = new PrintedPage(1, NULL, gfx::Size(1200, 500), - gfx::Rect(0, 0, 400, 1100), - true); + gfx::Rect(0, 0, 400, 1100)); page->GetCenteredPageContentRect(gfx::Size(1000, 1000), &page_content); EXPECT_EQ(0, page_content.x()); EXPECT_EQ(250, page_content.y()); @@ -55,8 +48,7 @@ TEST(PrintedPageTest, GetCenteredPageContentRect) { page = new PrintedPage(1, NULL, gfx::Size(500, 500), - gfx::Rect(0, 0, 400, 1100), - true); + gfx::Rect(0, 0, 400, 1100)); page->GetCenteredPageContentRect(gfx::Size(1000, 1000), &page_content); EXPECT_EQ(250, page_content.x()); EXPECT_EQ(250, page_content.y()); |