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 <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/callback.h" | 11 #include "base/callback.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "printing/print_settings.h" | 14 #include "printing/print_settings.h" |
15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class DictionaryValue; | 18 class DictionaryValue; |
19 } | 19 } |
20 | 20 |
21 namespace printing { | 21 namespace printing { |
22 | 22 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 virtual void Cancel() = 0; | 111 virtual void Cancel() = 0; |
112 | 112 |
113 // Releases the native printing context. | 113 // Releases the native printing context. |
114 virtual void ReleaseContext() = 0; | 114 virtual void ReleaseContext() = 0; |
115 | 115 |
116 // Returns the native context used to print. | 116 // Returns the native context used to print. |
117 virtual gfx::NativeDrawingContext context() const = 0; | 117 virtual gfx::NativeDrawingContext context() const = 0; |
118 | 118 |
119 // Creates an instance of this object. Implementers of this interface should | 119 // Creates an instance of this object. Implementers of this interface should |
120 // implement this method to create an object of their implementation. | 120 // implement this method to create an object of their implementation. |
121 static scoped_ptr<PrintingContext> Create(Delegate* delegate); | 121 static std::unique_ptr<PrintingContext> Create(Delegate* delegate); |
122 | 122 |
123 void set_margin_type(MarginType type); | 123 void set_margin_type(MarginType type); |
124 | 124 |
125 const PrintSettings& settings() const { | 125 const PrintSettings& settings() const { |
126 return settings_; | 126 return settings_; |
127 } | 127 } |
128 | 128 |
129 protected: | 129 protected: |
130 explicit PrintingContext(Delegate* delegate); | 130 explicit PrintingContext(Delegate* delegate); |
131 | 131 |
(...skipping 15 matching lines...) Expand all Loading... |
147 // Did the user cancel the print job. | 147 // Did the user cancel the print job. |
148 volatile bool abort_printing_; | 148 volatile bool abort_printing_; |
149 | 149 |
150 private: | 150 private: |
151 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 151 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
152 }; | 152 }; |
153 | 153 |
154 } // namespace printing | 154 } // namespace printing |
155 | 155 |
156 #endif // PRINTING_PRINTING_CONTEXT_H_ | 156 #endif // PRINTING_PRINTING_CONTEXT_H_ |
OLD | NEW |