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