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 | 7 |
8 #include "content/public/browser/javascript_dialogs.h" | 8 #include "content/public/browser/javascript_dialogs.h" |
9 #if defined(OS_LINUX) | |
jochen (gone - plz use gerrit)
2012/07/30 07:32:23
should be TOOLKIT_GTK?
also, please add an empty
Shouqun Liu
2012/07/30 08:08:44
Done.
| |
10 #include "ui/base/gtk/gtk_signal.h" | |
11 #endif | |
9 | 12 |
10 #if defined(OS_MACOSX) | 13 #if defined(OS_MACOSX) |
11 #if __OBJC__ | 14 #if __OBJC__ |
12 @class ShellJavaScriptDialogHelper; | 15 @class ShellJavaScriptDialogHelper; |
13 #else | 16 #else |
14 class ShellJavaScriptDialogHelper; | 17 class ShellJavaScriptDialogHelper; |
15 #endif // __OBJC__ | 18 #endif // __OBJC__ |
16 #endif // defined(OS_MACOSX) | 19 #endif // defined(OS_MACOSX) |
17 | 20 |
18 namespace content { | 21 namespace content { |
19 | 22 |
20 class ShellJavaScriptDialogCreator; | 23 class ShellJavaScriptDialogCreator; |
21 | 24 |
22 class ShellJavaScriptDialog { | 25 class ShellJavaScriptDialog { |
23 public: | 26 public: |
24 ShellJavaScriptDialog( | 27 ShellJavaScriptDialog( |
25 ShellJavaScriptDialogCreator* creator, | 28 ShellJavaScriptDialogCreator* creator, |
29 gfx::NativeWindow parent_window, | |
26 JavaScriptMessageType message_type, | 30 JavaScriptMessageType message_type, |
27 const string16& message_text, | 31 const string16& message_text, |
28 const string16& default_prompt_text, | 32 const string16& default_prompt_text, |
29 const JavaScriptDialogCreator::DialogClosedCallback& callback); | 33 const JavaScriptDialogCreator::DialogClosedCallback& callback); |
30 ~ShellJavaScriptDialog(); | 34 ~ShellJavaScriptDialog(); |
31 | 35 |
32 // Called to cancel a dialog mid-flight. | 36 // Called to cancel a dialog mid-flight. |
33 void Cancel(); | 37 void Cancel(); |
34 | 38 |
35 private: | 39 private: |
36 ShellJavaScriptDialogCreator* creator_; | 40 ShellJavaScriptDialogCreator* creator_; |
37 JavaScriptDialogCreator::DialogClosedCallback callback_; | 41 JavaScriptDialogCreator::DialogClosedCallback callback_; |
38 | 42 |
39 #if defined(OS_MACOSX) | 43 #if defined(OS_MACOSX) |
40 ShellJavaScriptDialogHelper* helper_; // owned | 44 ShellJavaScriptDialogHelper* helper_; // owned |
41 #elif defined(OS_WIN) | 45 #elif defined(OS_WIN) |
42 JavaScriptMessageType message_type_; | 46 JavaScriptMessageType message_type_; |
43 HWND dialog_win_; | 47 HWND dialog_win_; |
44 string16 message_text_; | 48 string16 message_text_; |
45 string16 default_prompt_text_; | 49 string16 default_prompt_text_; |
46 static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wparam, | 50 static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wparam, |
47 LPARAM lparam); | 51 LPARAM lparam); |
52 #elif defined(OS_LINUX) | |
53 GtkWidget* gtk_dialog_; | |
54 gfx::NativeWindow parent_window_; | |
55 CHROMEGTK_CALLBACK_1(ShellJavaScriptDialog, void, OnResponse, int); | |
48 #endif | 56 #endif |
49 | 57 |
50 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialog); | 58 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialog); |
51 }; | 59 }; |
52 | 60 |
53 } // namespace content | 61 } // namespace content |
54 | 62 |
55 #endif // CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_ | 63 #endif // CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_ |
OLD | NEW |