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

Side by Side Diff: printing/printed_document.cc

Issue 335473002: Guarded shrink setting with ifdefs to make clear where it is used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Thu 06/12/2014 0:59:45.49 Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « printing/printed_document.h ('k') | printing/printed_page.h » ('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_document.h" 5 #include "printing/printed_document.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 mutable_.expected_page_count_ += range.to - range.from + 1; 58 mutable_.expected_page_count_ += range.to - range.from + 1;
59 } 59 }
60 } 60 }
61 } 61 }
62 62
63 PrintedDocument::~PrintedDocument() { 63 PrintedDocument::~PrintedDocument() {
64 } 64 }
65 65
66 void PrintedDocument::SetPage(int page_number, 66 void PrintedDocument::SetPage(int page_number,
67 Metafile* metafile, 67 Metafile* metafile,
68 #if defined(OS_WIN)
68 double shrink, 69 double shrink,
70 #endif // OS_WIN
69 const gfx::Size& paper_size, 71 const gfx::Size& paper_size,
70 const gfx::Rect& page_rect) { 72 const gfx::Rect& page_rect) {
71 // Notice the page_number + 1, the reason is that this is the value that will 73 // Notice the page_number + 1, the reason is that this is the value that will
72 // be shown. Users dislike 0-based counting. 74 // be shown. Users dislike 0-based counting.
73 scoped_refptr<PrintedPage> page( 75 scoped_refptr<PrintedPage> page(
74 new PrintedPage(page_number + 1, 76 new PrintedPage(page_number + 1, metafile, paper_size, page_rect));
75 metafile, 77 #if defined(OS_WIN)
76 paper_size, 78 page->set_shrink_factor(shrink);
77 page_rect, 79 #endif // OS_WIN
78 shrink));
79 { 80 {
80 base::AutoLock lock(lock_); 81 base::AutoLock lock(lock_);
81 mutable_.pages_[page_number] = page; 82 mutable_.pages_[page_number] = page;
82 83
83 #if defined(OS_POSIX) && !defined(OS_MACOSX) 84 #if defined(OS_POSIX) && !defined(OS_MACOSX)
84 if (page_number < mutable_.first_page) 85 if (page_number < mutable_.first_page)
85 mutable_.first_page = page_number; 86 mutable_.first_page = page_number;
86 #endif 87 #endif
87 } 88 }
88 DebugDump(*page.get()); 89 DebugDump(*page.get());
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 229 }
229 230
230 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) 231 #if defined(OS_CHROMEOS) || defined(OS_ANDROID)
231 // This function is not used on aura linux/chromeos or android. 232 // This function is not used on aura linux/chromeos or android.
232 void PrintedDocument::RenderPrintedPage(const PrintedPage& page, 233 void PrintedDocument::RenderPrintedPage(const PrintedPage& page,
233 PrintingContext* context) const { 234 PrintingContext* context) const {
234 } 235 }
235 #endif 236 #endif
236 237
237 } // namespace printing 238 } // namespace printing
OLDNEW
« no previous file with comments | « printing/printed_document.h ('k') | printing/printed_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698