OLD | NEW |
---|---|
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 #ifndef PRINTING_PRINTING_CONTEXT_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_H_ |
6 #define PRINTING_PRINTING_CONTEXT_H_ | 6 #define PRINTING_PRINTING_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback_old.h" | 11 #include "base/callback_old.h" |
12 #include "base/logging.h" | |
12 #include "base/string16.h" | 13 #include "base/string16.h" |
13 #include "printing/print_settings.h" | 14 #include "printing/print_settings.h" |
14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class DictionaryValue; | 18 class DictionaryValue; |
18 } | 19 } |
19 | 20 |
20 namespace printing { | 21 namespace printing { |
21 | 22 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 virtual void ReleaseContext() = 0; | 92 virtual void ReleaseContext() = 0; |
92 | 93 |
93 // Returns the native context used to print. | 94 // Returns the native context used to print. |
94 virtual gfx::NativeDrawingContext context() const = 0; | 95 virtual gfx::NativeDrawingContext context() const = 0; |
95 | 96 |
96 // Creates an instance of this object. Implementers of this interface should | 97 // Creates an instance of this object. Implementers of this interface should |
97 // implement this method to create an object of their implementation. The | 98 // implement this method to create an object of their implementation. The |
98 // caller owns the returned object. | 99 // caller owns the returned object. |
99 static PrintingContext* Create(const std::string& app_locale); | 100 static PrintingContext* Create(const std::string& app_locale); |
100 | 101 |
101 void set_use_overlays(bool use_overlays) { | 102 void set_margin_type(MarginType type) { |
102 settings_.use_overlays = use_overlays; | 103 DCHECK(type != CUSTOM_MARGINS); |
Lei Zhang
2011/10/08 02:02:05
Clang probably won't like this. Move into .cc file
vandebo (ex-Chrome)
2011/10/15 00:42:50
Done.
| |
104 settings_.margin_type = type; | |
103 } | 105 } |
104 | 106 |
105 const PrintSettings& settings() const { | 107 const PrintSettings& settings() const { |
106 return settings_; | 108 return settings_; |
107 } | 109 } |
108 | 110 |
109 protected: | 111 protected: |
110 explicit PrintingContext(const std::string& app_locale); | 112 explicit PrintingContext(const std::string& app_locale); |
111 | 113 |
112 // Reinitializes the settings for object reuse. | 114 // Reinitializes the settings for object reuse. |
(...skipping 16 matching lines...) Expand all Loading... | |
129 | 131 |
130 // The application locale. | 132 // The application locale. |
131 std::string app_locale_; | 133 std::string app_locale_; |
132 | 134 |
133 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 135 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
134 }; | 136 }; |
135 | 137 |
136 } // namespace printing | 138 } // namespace printing |
137 | 139 |
138 #endif // PRINTING_PRINTING_CONTEXT_H_ | 140 #endif // PRINTING_PRINTING_CONTEXT_H_ |
OLD | NEW |