Removed a line that dispatches the 'cancelOverlay' event. This line was added by...
[chromium-blink-merge.git] / content / shell / browser / shell_javascript_dialog.h
blobb2d4d42b916499ad03ccaff94d8fef8d805031ad
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_H_
6 #define CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_H_
8 #include "content/public/browser/javascript_dialog_manager.h"
10 #if defined(OS_MACOSX)
11 #if __OBJC__
12 @class ShellJavaScriptDialogHelper;
13 #else
14 class ShellJavaScriptDialogHelper;
15 #endif // __OBJC__
16 #endif // defined(OS_MACOSX)
18 namespace content {
20 class ShellJavaScriptDialogManager;
22 class ShellJavaScriptDialog {
23 public:
24 ShellJavaScriptDialog(
25 ShellJavaScriptDialogManager* manager,
26 gfx::NativeWindow parent_window,
27 JavaScriptMessageType message_type,
28 const base::string16& message_text,
29 const base::string16& default_prompt_text,
30 const JavaScriptDialogManager::DialogClosedCallback& callback);
31 ~ShellJavaScriptDialog();
33 // Called to cancel a dialog mid-flight.
34 void Cancel();
36 private:
37 ShellJavaScriptDialogManager* manager_;
38 JavaScriptDialogManager::DialogClosedCallback callback_;
40 #if defined(OS_MACOSX)
41 ShellJavaScriptDialogHelper* helper_; // owned
42 #elif defined(OS_WIN)
43 JavaScriptMessageType message_type_;
44 HWND dialog_win_;
45 base::string16 message_text_;
46 base::string16 default_prompt_text_;
47 static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wparam,
48 LPARAM lparam);
49 #endif
51 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialog);
54 } // namespace content
56 #endif // CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_H_