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

Side by Side Diff: chrome/browser/printing/printed_document.cc

Issue 1954: Two minor fixes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 3 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 | « no previous file | chrome/browser/printing/win_printing_context.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/printing/printed_document.h" 5 #include "chrome/browser/printing/printed_document.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/gfx/platform_device_win.h" 9 #include "base/gfx/platform_device_win.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 if (!page.emf()->SafePlayback(context)) { 122 if (!page.emf()->SafePlayback(context)) {
123 NOTREACHED(); 123 NOTREACHED();
124 } 124 }
125 125
126 res = RestoreDC(context, saved_state); 126 res = RestoreDC(context, saved_state);
127 DCHECK_NE(res, 0); 127 DCHECK_NE(res, 0);
128 } 128 }
129 129
130 // Print the header and footer. 130 // Print the header and footer.
131 int base_font_size = ChromeFont().height(); 131 int base_font_size = ChromeFont().height();
132 int new_font_size = ConvertUnit(10, 72, immutable_.settings_.dpi()); 132 int new_font_size = ConvertUnit(10,
133 immutable_.settings_.desired_dpi,
134 immutable_.settings_.dpi());
133 DCHECK_GT(new_font_size, base_font_size); 135 DCHECK_GT(new_font_size, base_font_size);
134 ChromeFont font(ChromeFont().DeriveFont(new_font_size - base_font_size)); 136 ChromeFont font(ChromeFont().DeriveFont(new_font_size - base_font_size));
135 HGDIOBJ old_font = SelectObject(context, font.hfont()); 137 HGDIOBJ old_font = SelectObject(context, font.hfont());
136 DCHECK(old_font != NULL); 138 DCHECK(old_font != NULL);
137 // We don't want a white square around the text ever if overflowing. 139 // We don't want a white square around the text ever if overflowing.
138 SetBkMode(context, TRANSPARENT); 140 SetBkMode(context, TRANSPARENT);
139 PrintHeaderFooter(context, page, PageOverlays::LEFT, PageOverlays::TOP, 141 PrintHeaderFooter(context, page, PageOverlays::LEFT, PageOverlays::TOP,
140 font); 142 font);
141 PrintHeaderFooter(context, page, PageOverlays::CENTER, PageOverlays::TOP, 143 PrintHeaderFooter(context, page, PageOverlays::CENTER, PageOverlays::TOP,
142 font); 144 font);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 time_ = win_util::FormatSystemTime(systemtime, std::wstring()); 370 time_ = win_util::FormatSystemTime(systemtime, std::wstring());
369 #else 371 #else
370 Time now = Time::Now(); 372 Time now = Time::Now();
371 date_ = TimeFormat::ShortDateNumeric(now); 373 date_ = TimeFormat::ShortDateNumeric(now);
372 time_ = TimeFormat::TimeOfDay(now); 374 time_ = TimeFormat::TimeOfDay(now);
373 #endif // WIN32 375 #endif // WIN32
374 } 376 }
375 377
376 } // namespace printing 378 } // namespace printing
377 379
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/win_printing_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698