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 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
17 #include "content/public/browser/web_ui_message_handler.h" | 17 #include "content/public/browser/web_ui_message_handler.h" |
18 #include "ui/web_dialogs/web_dialog_delegate.h" | 18 #include "ui/web_dialogs/web_dialog_delegate.h" |
19 #include "ui/web_dialogs/web_dialog_ui.h" | 19 #include "ui/web_dialogs/web_dialog_ui.h" |
20 | 20 |
| 21 class CloudPrintWebDialogDelegateTest; |
21 class GURL; | 22 class GURL; |
22 class CloudPrintWebDialogDelegateTest; | |
23 | 23 |
24 namespace base { | 24 namespace base { |
25 class ListValue; | 25 class ListValue; |
26 class StringValue; | |
27 class Value; | 26 class Value; |
28 } | 27 } |
29 | 28 |
30 namespace internal_cloud_print_helpers { | 29 namespace internal_cloud_print_helpers { |
31 | 30 |
32 // Small class to virtualize a few functions to aid with unit testing. | 31 // Small class to virtualize a few functions to aid with unit testing. |
33 class CloudPrintDataSenderHelper { | 32 class CloudPrintDataSenderHelper { |
34 public: | 33 public: |
35 explicit CloudPrintDataSenderHelper(content::WebUI* web_ui) | 34 explicit CloudPrintDataSenderHelper(content::WebUI* web_ui) |
36 : web_ui_(web_ui) {} | 35 : web_ui_(web_ui) {} |
37 virtual ~CloudPrintDataSenderHelper() {} | 36 virtual ~CloudPrintDataSenderHelper() {} |
38 | 37 |
39 // Virtualize the overrides of these three functions from WebUI to | 38 // Virtualize the overrides of this function from WebUI to facilitate unit |
40 // facilitate unit testing. | 39 // testing. |
41 virtual void CallJavascriptFunction(const std::wstring& function_name); | 40 virtual void CallJavascriptFunction(const std::string& function_name, |
42 virtual void CallJavascriptFunction(const std::wstring& function_name, | |
43 const base::Value& arg); | |
44 virtual void CallJavascriptFunction(const std::wstring& function_name, | |
45 const base::Value& arg1, | 41 const base::Value& arg1, |
46 const base::Value& arg2); | 42 const base::Value& arg2); |
47 virtual void CallJavascriptFunction(const std::wstring& function_name, | |
48 const base::Value& arg1, | |
49 const base::Value& arg2, | |
50 const base::Value& arg3); | |
51 | 43 |
52 private: | 44 private: |
53 content::WebUI* web_ui_; | 45 content::WebUI* web_ui_; |
54 | 46 |
55 DISALLOW_COPY_AND_ASSIGN(CloudPrintDataSenderHelper); | 47 DISALLOW_COPY_AND_ASSIGN(CloudPrintDataSenderHelper); |
56 }; | 48 }; |
57 | 49 |
58 // Small helper class to get the print data loaded in from the PDF | 50 // Small helper class to get the print data loaded in from the PDF |
59 // file (on the FILE thread) and send it to the print dialog contents | 51 // file (on the FILE thread) and send it to the print dialog contents |
60 // (on the IO thread), allowing for cancellation. | 52 // (on the IO thread), allowing for cancellation. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 const string16& print_ticket, | 208 const string16& print_ticket, |
217 const std::string& file_type, | 209 const std::string& file_type, |
218 bool delete_on_close); | 210 bool delete_on_close); |
219 void CreateDialogSigninImpl(content::BrowserContext* browser_context, | 211 void CreateDialogSigninImpl(content::BrowserContext* browser_context, |
220 gfx::NativeWindow modal_parent, | 212 gfx::NativeWindow modal_parent, |
221 const base::Closure& callback); | 213 const base::Closure& callback); |
222 | 214 |
223 } // namespace internal_cloud_print_helpers | 215 } // namespace internal_cloud_print_helpers |
224 | 216 |
225 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ | 217 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ |
OLD | NEW |