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" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 const PrintSettings& settings() const { | 97 const PrintSettings& settings() const { |
98 return settings_; | 98 return settings_; |
99 } | 99 } |
100 | 100 |
101 protected: | 101 protected: |
102 explicit PrintingContext(const std::string& app_locale); | 102 explicit PrintingContext(const std::string& app_locale); |
103 | 103 |
104 // Reinitializes the settings for object reuse. | 104 // Reinitializes the settings for object reuse. |
105 void ResetSettings(); | 105 void ResetSettings(); |
106 | 106 |
| 107 // Extracts print job settings from |settings|. Out parameters can be NULL. |
| 108 // Returns true if all non-NULL out parameters are successfully extracted |
| 109 // from |settings| else returns false. |
| 110 bool GetSettingsFromDict(const DictionaryValue& settings, |
| 111 bool* landscape, |
| 112 string16* printerName); |
| 113 |
107 // Does bookkeeping when an error occurs. | 114 // Does bookkeeping when an error occurs. |
108 PrintingContext::Result OnError(); | 115 PrintingContext::Result OnError(); |
109 | 116 |
110 // Complete print context settings. | 117 // Complete print context settings. |
111 PrintSettings settings_; | 118 PrintSettings settings_; |
112 | 119 |
113 // The dialog box has been dismissed. | 120 // The dialog box has been dismissed. |
114 volatile bool dialog_box_dismissed_; | 121 volatile bool dialog_box_dismissed_; |
115 | 122 |
116 // Is a print job being done. | 123 // Is a print job being done. |
117 volatile bool in_print_job_; | 124 volatile bool in_print_job_; |
118 | 125 |
119 // Did the user cancel the print job. | 126 // Did the user cancel the print job. |
120 volatile bool abort_printing_; | 127 volatile bool abort_printing_; |
121 | 128 |
122 // The application locale. | 129 // The application locale. |
123 std::string app_locale_; | 130 std::string app_locale_; |
124 | 131 |
125 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 132 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
126 }; | 133 }; |
127 | 134 |
128 } // namespace printing | 135 } // namespace printing |
129 | 136 |
130 #endif // PRINTING_PRINTING_CONTEXT_H_ | 137 #endif // PRINTING_PRINTING_CONTEXT_H_ |
OLD | NEW |