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

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

Issue 125109: Refactor the PlatformContext layer to have only one class. (Closed)
Patch Set: Created 11 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
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 "app/gfx/font.h" 9 #include "app/gfx/font.h"
10 #include "app/gfx/text_elider.h" 10 #include "app/gfx/text_elider.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // Make sure the page is from our list. 96 // Make sure the page is from our list.
97 AutoLock lock(lock_); 97 AutoLock lock(lock_);
98 DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get()); 98 DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get());
99 } 99 }
100 #endif 100 #endif
101 101
102 // Save the state to make sure the context this function call does not modify 102 // Save the state to make sure the context this function call does not modify
103 // the device context. 103 // the device context.
104 int saved_state = SaveDC(context); 104 int saved_state = SaveDC(context);
105 DCHECK_NE(saved_state, 0); 105 DCHECK_NE(saved_state, 0);
106 skia::PlatformDeviceWin::InitializeDC(context); 106 skia::PlatformDevice::InitializeDC(context);
107 { 107 {
108 // Save the state (again) to apply the necessary world transformation. 108 // Save the state (again) to apply the necessary world transformation.
109 int saved_state = SaveDC(context); 109 int saved_state = SaveDC(context);
110 DCHECK_NE(saved_state, 0); 110 DCHECK_NE(saved_state, 0);
111 111
112 // Setup the matrix to translate and scale to the right place. Take in 112 // Setup the matrix to translate and scale to the right place. Take in
113 // account the actual shrinking factor. 113 // account the actual shrinking factor.
114 XFORM xform = { 0 }; 114 XFORM xform = { 0 };
115 xform.eDx = static_cast<float>( 115 xform.eDx = static_cast<float>(
116 immutable_.settings_.page_setup_pixels().content_area().x()); 116 immutable_.settings_.page_setup_pixels().content_area().x());
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 date_ = win_util::FormatSystemDate(systemtime, std::wstring()); 371 date_ = win_util::FormatSystemDate(systemtime, std::wstring());
372 time_ = win_util::FormatSystemTime(systemtime, std::wstring()); 372 time_ = win_util::FormatSystemTime(systemtime, std::wstring());
373 #else 373 #else
374 Time now = Time::Now(); 374 Time now = Time::Now();
375 date_ = TimeFormat::ShortDateNumeric(now); 375 date_ = TimeFormat::ShortDateNumeric(now);
376 time_ = TimeFormat::TimeOfDay(now); 376 time_ = TimeFormat::TimeOfDay(now);
377 #endif // WIN32 377 #endif // WIN32
378 } 378 }
379 379
380 } // namespace printing 380 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/gtk/tabs/tab_strip_gtk.cc ('k') | chrome/browser/printing/printing_layout_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698