| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "chrome/browser/ui/webui/web_dialog_ui.h" | 16 #include "ui/web_dialogs/web_dialog_ui.h" |
| 17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 19 #include "content/public/browser/web_ui_message_handler.h" | 19 #include "content/public/browser/web_ui_message_handler.h" |
| 20 | 20 |
| 21 class GURL; | 21 class GURL; |
| 22 class CloudPrintWebDialogDelegateTest; | 22 class CloudPrintWebDialogDelegateTest; |
| 23 | 23 |
| 24 namespace base { | 24 namespace base { |
| 25 class ListValue; | 25 class ListValue; |
| 26 class StringValue; | 26 class StringValue; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 scoped_ptr<CloudPrintDataSenderHelper> print_data_helper_; | 149 scoped_ptr<CloudPrintDataSenderHelper> print_data_helper_; |
| 150 bool close_after_signin_; | 150 bool close_after_signin_; |
| 151 base::Closure callback_; | 151 base::Closure callback_; |
| 152 | 152 |
| 153 DISALLOW_COPY_AND_ASSIGN(CloudPrintFlowHandler); | 153 DISALLOW_COPY_AND_ASSIGN(CloudPrintFlowHandler); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 // State machine used to run the printing dialog. This class is used | 156 // State machine used to run the printing dialog. This class is used |
| 157 // to open and run the web dialog and deletes itself when the dialog | 157 // to open and run the web dialog and deletes itself when the dialog |
| 158 // is closed. | 158 // is closed. |
| 159 class CloudPrintWebDialogDelegate : public WebDialogDelegate { | 159 class CloudPrintWebDialogDelegate : public views::WebDialogDelegate { |
| 160 public: | 160 public: |
| 161 CloudPrintWebDialogDelegate(const FilePath& path_to_file, | 161 CloudPrintWebDialogDelegate(const FilePath& path_to_file, |
| 162 int width, int height, | 162 int width, int height, |
| 163 const std::string& json_arguments, | 163 const std::string& json_arguments, |
| 164 const string16& print_job_title, | 164 const string16& print_job_title, |
| 165 const string16& print_ticket, | 165 const string16& print_ticket, |
| 166 const std::string& file_type, | 166 const std::string& file_type, |
| 167 bool modal, | 167 bool modal, |
| 168 bool delete_on_close, | 168 bool delete_on_close, |
| 169 bool close_after_signin, | 169 bool close_after_signin, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 196 bool delete_on_close); | 196 bool delete_on_close); |
| 197 void Init(int width, int height, const std::string& json_arguments); | 197 void Init(int width, int height, const std::string& json_arguments); |
| 198 | 198 |
| 199 bool delete_on_close_; | 199 bool delete_on_close_; |
| 200 CloudPrintFlowHandler* flow_handler_; | 200 CloudPrintFlowHandler* flow_handler_; |
| 201 bool modal_; | 201 bool modal_; |
| 202 mutable bool owns_flow_handler_; | 202 mutable bool owns_flow_handler_; |
| 203 FilePath path_to_file_; | 203 FilePath path_to_file_; |
| 204 | 204 |
| 205 // The parameters needed to display a modal web dialog. | 205 // The parameters needed to display a modal web dialog. |
| 206 WebDialogUI::WebDialogParams params_; | 206 views::WebDialogUI::WebDialogParams params_; |
| 207 | 207 |
| 208 DISALLOW_COPY_AND_ASSIGN(CloudPrintWebDialogDelegate); | 208 DISALLOW_COPY_AND_ASSIGN(CloudPrintWebDialogDelegate); |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 void CreateDialogFullImpl(const FilePath& path_to_file, | 211 void CreateDialogFullImpl(const FilePath& path_to_file, |
| 212 const string16& print_job_title, | 212 const string16& print_job_title, |
| 213 const string16& print_ticket, | 213 const string16& print_ticket, |
| 214 const std::string& file_type, | 214 const std::string& file_type, |
| 215 bool modal, | 215 bool modal, |
| 216 bool delete_on_close); | 216 bool delete_on_close); |
| 217 void CreateDialogSigninImpl(const base::Closure& callback); | 217 void CreateDialogSigninImpl(const base::Closure& callback); |
| 218 | 218 |
| 219 void Delete(const FilePath& path_to_file); | 219 void Delete(const FilePath& path_to_file); |
| 220 | 220 |
| 221 } // namespace internal_cloud_print_helpers | 221 } // namespace internal_cloud_print_helpers |
| 222 | 222 |
| 223 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ | 223 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ |
| OLD | NEW |