OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 // Releases the native printing context. | 78 // Releases the native printing context. |
79 virtual void ReleaseContext() = 0; | 79 virtual void ReleaseContext() = 0; |
80 | 80 |
81 // Returns the native context used to print. | 81 // Returns the native context used to print. |
82 virtual gfx::NativeDrawingContext context() const = 0; | 82 virtual gfx::NativeDrawingContext context() const = 0; |
83 | 83 |
84 // Creates an instance of this object. Implementers of this interface should | 84 // Creates an instance of this object. Implementers of this interface should |
85 // implement this method to create an object of their implementation. The | 85 // implement this method to create an object of their implementation. The |
86 // caller owns the returned object. | 86 // caller owns the returned object. |
87 static PrintingContext* Create(); | 87 static PrintingContext* Create(const std::string& app_locale); |
88 | 88 |
89 void set_use_overlays(bool use_overlays) { | 89 void set_use_overlays(bool use_overlays) { |
90 settings_.use_overlays = use_overlays; | 90 settings_.use_overlays = use_overlays; |
91 } | 91 } |
92 | 92 |
93 const PrintSettings& settings() const { | 93 const PrintSettings& settings() const { |
94 return settings_; | 94 return settings_; |
95 } | 95 } |
96 | 96 |
97 protected: | 97 protected: |
98 PrintingContext(); | 98 explicit PrintingContext(const std::string& app_locale); |
99 | 99 |
100 // Reinitializes the settings for object reuse. | 100 // Reinitializes the settings for object reuse. |
101 void ResetSettings(); | 101 void ResetSettings(); |
102 | 102 |
103 // Does bookkeeping when an error occurs. | 103 // Does bookkeeping when an error occurs. |
104 PrintingContext::Result OnError(); | 104 PrintingContext::Result OnError(); |
105 | 105 |
106 // Complete print context settings. | 106 // Complete print context settings. |
107 PrintSettings settings_; | 107 PrintSettings settings_; |
108 | 108 |
109 // The dialog box has been dismissed. | 109 // The dialog box has been dismissed. |
110 volatile bool dialog_box_dismissed_; | 110 volatile bool dialog_box_dismissed_; |
111 | 111 |
112 // Is a print job being done. | 112 // Is a print job being done. |
113 volatile bool in_print_job_; | 113 volatile bool in_print_job_; |
114 | 114 |
115 // Did the user cancel the print job. | 115 // Did the user cancel the print job. |
116 volatile bool abort_printing_; | 116 volatile bool abort_printing_; |
117 | 117 |
| 118 // The application locale. |
| 119 std::string app_locale_; |
| 120 |
118 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 121 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
119 }; | 122 }; |
120 | 123 |
121 } // namespace printing | 124 } // namespace printing |
122 | 125 |
123 #endif // PRINTING_PRINTING_CONTEXT_H_ | 126 #endif // PRINTING_PRINTING_CONTEXT_H_ |
OLD | NEW |