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

Side by Side Diff: printing/printed_page.cc

Issue 1863223002: Convert //printing to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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_page.h ('k') | printing/printed_page_unittest.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> 7 #include <utility>
8 8
9 namespace printing { 9 namespace printing {
10 10
11 PrintedPage::PrintedPage(int page_number, 11 PrintedPage::PrintedPage(int page_number,
12 scoped_ptr<MetafilePlayer> metafile, 12 std::unique_ptr<MetafilePlayer> metafile,
13 const gfx::Size& page_size, 13 const gfx::Size& page_size,
14 const gfx::Rect& page_content_rect) 14 const gfx::Rect& page_content_rect)
15 : page_number_(page_number), 15 : page_number_(page_number),
16 metafile_(std::move(metafile)), 16 metafile_(std::move(metafile)),
17 #if defined(OS_WIN) 17 #if defined(OS_WIN)
18 shrink_factor_(0.0f), 18 shrink_factor_(0.0f),
19 #endif // OS_WIN 19 #endif // OS_WIN
20 page_size_(page_size), 20 page_size_(page_size),
21 page_content_rect_(page_content_rect) { 21 page_content_rect_(page_content_rect) {
22 } 22 }
(...skipping 12 matching lines...) Expand all
35 int diff = paper_size.width() - page_size().width(); 35 int diff = paper_size.width() - page_size().width();
36 content_rect->set_x(content_rect->x() + diff / 2); 36 content_rect->set_x(content_rect->x() + diff / 2);
37 } 37 }
38 if (paper_size.height() > page_size().height()) { 38 if (paper_size.height() > page_size().height()) {
39 int diff = paper_size.height() - page_size().height(); 39 int diff = paper_size.height() - page_size().height();
40 content_rect->set_y(content_rect->y() + diff / 2); 40 content_rect->set_y(content_rect->y() + diff / 2);
41 } 41 }
42 } 42 }
43 43
44 } // namespace printing 44 } // namespace printing
OLDNEW
« no previous file with comments | « printing/printed_page.h ('k') | printing/printed_page_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698