OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ |
6 #define CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 DISALLOW_COPY_AND_ASSIGN(CloudPrintFlowHandler); | 140 DISALLOW_COPY_AND_ASSIGN(CloudPrintFlowHandler); |
141 }; | 141 }; |
142 | 142 |
143 // State machine used to run the printing dialog. This class is used | 143 // State machine used to run the printing dialog. This class is used |
144 // to open and run the web dialog and deletes itself when the dialog | 144 // to open and run the web dialog and deletes itself when the dialog |
145 // is closed. | 145 // is closed. |
146 class CloudPrintWebDialogDelegate : public ui::WebDialogDelegate { | 146 class CloudPrintWebDialogDelegate : public ui::WebDialogDelegate { |
147 public: | 147 public: |
148 CloudPrintWebDialogDelegate(content::BrowserContext* browser_context, | 148 CloudPrintWebDialogDelegate(content::BrowserContext* browser_context, |
149 gfx::NativeWindow modal_parent, | 149 gfx::NativeView modal_parent, |
150 const base::RefCountedMemory* data, | 150 const base::RefCountedMemory* data, |
151 const std::string& json_arguments, | 151 const std::string& json_arguments, |
152 const base::string16& print_job_title, | 152 const base::string16& print_job_title, |
153 const base::string16& print_ticket, | 153 const base::string16& print_ticket, |
154 const std::string& file_type); | 154 const std::string& file_type); |
155 ~CloudPrintWebDialogDelegate() override; | 155 ~CloudPrintWebDialogDelegate() override; |
156 | 156 |
157 // ui::WebDialogDelegate implementation: | 157 // ui::WebDialogDelegate implementation: |
158 ui::ModalType GetDialogModalType() const override; | 158 ui::ModalType GetDialogModalType() const override; |
159 base::string16 GetDialogTitle() const override; | 159 base::string16 GetDialogTitle() const override; |
(...skipping 11 matching lines...) Expand all Loading... |
171 private: | 171 private: |
172 friend class ::CloudPrintWebDialogDelegateTest; | 172 friend class ::CloudPrintWebDialogDelegateTest; |
173 | 173 |
174 // For unit testing. | 174 // For unit testing. |
175 CloudPrintWebDialogDelegate(CloudPrintFlowHandler* flow_handler, | 175 CloudPrintWebDialogDelegate(CloudPrintFlowHandler* flow_handler, |
176 const std::string& json_arguments); | 176 const std::string& json_arguments); |
177 void Init(content::BrowserContext* browser_context, | 177 void Init(content::BrowserContext* browser_context, |
178 const std::string& json_arguments); | 178 const std::string& json_arguments); |
179 | 179 |
180 CloudPrintFlowHandler* flow_handler_; | 180 CloudPrintFlowHandler* flow_handler_; |
181 gfx::NativeWindow modal_parent_; | 181 gfx::NativeView modal_parent_; |
182 mutable bool owns_flow_handler_; | 182 mutable bool owns_flow_handler_; |
183 bool keep_alive_when_non_modal_; | 183 bool keep_alive_when_non_modal_; |
184 | 184 |
185 // The parameters needed to display a modal web dialog. | 185 // The parameters needed to display a modal web dialog. |
186 ui::WebDialogUI::WebDialogParams params_; | 186 ui::WebDialogUI::WebDialogParams params_; |
187 | 187 |
188 DISALLOW_COPY_AND_ASSIGN(CloudPrintWebDialogDelegate); | 188 DISALLOW_COPY_AND_ASSIGN(CloudPrintWebDialogDelegate); |
189 }; | 189 }; |
190 | 190 |
191 void CreateDialogForFileImpl(content::BrowserContext* browser_context, | 191 void CreateDialogForFileImpl(content::BrowserContext* browser_context, |
192 gfx::NativeWindow modal_parent, | 192 gfx::NativeView modal_parent, |
193 const base::FilePath& path_to_file, | 193 const base::FilePath& path_to_file, |
194 const base::string16& print_job_title, | 194 const base::string16& print_job_title, |
195 const base::string16& print_ticket, | 195 const base::string16& print_ticket, |
196 const std::string& file_type); | 196 const std::string& file_type); |
197 | 197 |
198 } // namespace internal_cloud_print_helpers | 198 } // namespace internal_cloud_print_helpers |
199 | 199 |
200 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ | 200 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ |
OLD | NEW |