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

Side by Side Diff: printing/custom_scaling.cc

Issue 10348002: ugrr... Fixing printing scaling again. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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/custom_scaling.h ('k') | printing/printing.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "printing/custom_scaling.h"
6
7 #include "base/threading/thread_local.h"
8
9 namespace printing {
10
11 static base::ThreadLocalPointer<double> gPrintingPageScale;
12
13 bool GetCustomPrintingPageScale(double* scale) {
14 double* ptr = gPrintingPageScale.Get();
15 if (ptr != NULL) {
16 *scale = *ptr;
17 }
18 return ptr != NULL;
19 }
20
21 void SetCustomPrintingPageScale(double scale) {
22 ClearCustomPrintingPageScale();
23 double* ptr = new double;
24 *ptr = scale;
25 gPrintingPageScale.Set(ptr);
26 }
27
28 void ClearCustomPrintingPageScale() {
29 double* ptr = gPrintingPageScale.Get();
30 if (ptr != NULL) {
31 delete ptr;
32 }
33 gPrintingPageScale.Set(NULL);
34 }
35
36 } // namespace printing
37
OLDNEW
« no previous file with comments | « printing/custom_scaling.h ('k') | printing/printing.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698