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

Side by Side Diff: printing/printed_page.cc

Issue 1550693002: Global conversion of Pass()→std::move() on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « printing/printed_document.cc ('k') | remoting/host/video_frame_recorder_host_extension.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "printing/printed_page.h" 5 #include "printing/printed_page.h"
6 6
7 #include <utility>
8
7 namespace printing { 9 namespace printing {
8 10
9 PrintedPage::PrintedPage(int page_number, 11 PrintedPage::PrintedPage(int page_number,
10 scoped_ptr<MetafilePlayer> metafile, 12 scoped_ptr<MetafilePlayer> metafile,
11 const gfx::Size& page_size, 13 const gfx::Size& page_size,
12 const gfx::Rect& page_content_rect) 14 const gfx::Rect& page_content_rect)
13 : page_number_(page_number), 15 : page_number_(page_number),
14 metafile_(metafile.Pass()), 16 metafile_(std::move(metafile)),
15 #if defined(OS_WIN) 17 #if defined(OS_WIN)
16 shrink_factor_(0.0f), 18 shrink_factor_(0.0f),
17 #endif // OS_WIN 19 #endif // OS_WIN
18 page_size_(page_size), 20 page_size_(page_size),
19 page_content_rect_(page_content_rect) { 21 page_content_rect_(page_content_rect) {
20 } 22 }
21 23
22 PrintedPage::~PrintedPage() { 24 PrintedPage::~PrintedPage() {
23 } 25 }
24 26
25 const MetafilePlayer* PrintedPage::metafile() const { 27 const MetafilePlayer* PrintedPage::metafile() const {
26 return metafile_.get(); 28 return metafile_.get();
27 } 29 }
28 30
29 void PrintedPage::GetCenteredPageContentRect( 31 void PrintedPage::GetCenteredPageContentRect(
30 const gfx::Size& paper_size, gfx::Rect* content_rect) const { 32 const gfx::Size& paper_size, gfx::Rect* content_rect) const {
31 *content_rect = page_content_rect(); 33 *content_rect = page_content_rect();
32 if (paper_size.width() > page_size().width()) { 34 if (paper_size.width() > page_size().width()) {
33 int diff = paper_size.width() - page_size().width(); 35 int diff = paper_size.width() - page_size().width();
34 content_rect->set_x(content_rect->x() + diff / 2); 36 content_rect->set_x(content_rect->x() + diff / 2);
35 } 37 }
36 if (paper_size.height() > page_size().height()) { 38 if (paper_size.height() > page_size().height()) {
37 int diff = paper_size.height() - page_size().height(); 39 int diff = paper_size.height() - page_size().height();
38 content_rect->set_y(content_rect->y() + diff / 2); 40 content_rect->set_y(content_rect->y() + diff / 2);
39 } 41 }
40 } 42 }
41 43
42 } // namespace printing 44 } // namespace printing
OLDNEW
« no previous file with comments | « printing/printed_document.cc ('k') | remoting/host/video_frame_recorder_host_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698