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 CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_ | 5 #ifndef CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_ |
6 #define CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_ | 6 #define CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/public/browser/javascript_dialogs.h" | 9 #include "content/public/browser/javascript_dialogs.h" |
10 | 10 |
11 #if defined(OS_MACOSX) | 11 #if defined(OS_MACOSX) |
12 #if __OBJC__ | 12 #if __OBJC__ |
13 @class ShellJavaScriptDialogHelper; | 13 @class ShellJavaScriptDialogHelper; |
14 #else | 14 #else |
15 class ShellJavaScriptDialogHelper; | 15 class ShellJavaScriptDialogHelper; |
16 #endif // __OBJC__ | 16 #endif // __OBJC__ |
17 #endif // defined(OS_MACOSX) | 17 #endif // defined(OS_MACOSX) |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 class ShellJavaScriptDialogCreator; | 21 class ShellJavaScriptDialogCreator; |
22 | 22 |
23 class ShellJavaScriptDialog { | 23 class ShellJavaScriptDialog { |
24 public: | 24 public: |
25 ShellJavaScriptDialog( | 25 ShellJavaScriptDialog( |
26 ShellJavaScriptDialogCreator* creator, | 26 ShellJavaScriptDialogCreator* creator, |
27 ui::JavascriptMessageType javascript_message_type, | 27 JavaScriptMessageType message_type, |
28 const string16& message_text, | 28 const string16& message_text, |
29 const string16& default_prompt_text, | 29 const string16& default_prompt_text, |
30 const JavaScriptDialogCreator::DialogClosedCallback& callback); | 30 const JavaScriptDialogCreator::DialogClosedCallback& callback); |
31 ~ShellJavaScriptDialog(); | 31 ~ShellJavaScriptDialog(); |
32 | 32 |
33 // Called to cancel a dialog mid-flight. | 33 // Called to cancel a dialog mid-flight. |
34 void Cancel(); | 34 void Cancel(); |
35 | 35 |
36 private: | 36 private: |
37 ShellJavaScriptDialogCreator* creator_; | 37 ShellJavaScriptDialogCreator* creator_; |
38 JavaScriptDialogCreator::DialogClosedCallback callback_; | 38 JavaScriptDialogCreator::DialogClosedCallback callback_; |
39 | 39 |
40 #if defined(OS_MACOSX) | 40 #if defined(OS_MACOSX) |
41 ShellJavaScriptDialogHelper* helper_; // owned | 41 ShellJavaScriptDialogHelper* helper_; // owned |
42 #elif defined(OS_WIN) | 42 #elif defined(OS_WIN) |
43 ui::JavascriptMessageType message_type_; | 43 JavaScriptMessageType message_type_; |
44 HWND dialog_win_; | 44 HWND dialog_win_; |
45 string16 message_text_; | 45 string16 message_text_; |
46 string16 default_prompt_text_; | 46 string16 default_prompt_text_; |
47 static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wparam, | 47 static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wparam, |
48 LPARAM lparam); | 48 LPARAM lparam); |
49 #endif | 49 #endif |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialog); | 51 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialog); |
52 }; | 52 }; |
53 | 53 |
54 } // namespace content | 54 } // namespace content |
55 | 55 |
56 #endif // CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_ | 56 #endif // CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_ |
OLD | NEW |