Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(873)

Side by Side Diff: content/shell/shell_javascript_dialog.h

Issue 9961013: Minor cleaning of shell javascript dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/shell/shell_javascript_dialog_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 NSAlert;
14 @class ShellJavaScriptDialogHelper; 13 @class ShellJavaScriptDialogHelper;
15 #else 14 #else
16 class NSAlert;
17 class ShellJavaScriptDialogHelper; 15 class ShellJavaScriptDialogHelper;
18 #endif // __OBJC__ 16 #endif // __OBJC__
19 #endif // defined(OS_MACOSX) 17 #endif // defined(OS_MACOSX)
20 18
21 namespace content { 19 namespace content {
22 20
23 class ShellJavaScriptDialogCreator; 21 class ShellJavaScriptDialogCreator;
24 22
25 class ShellJavaScriptDialog { 23 class ShellJavaScriptDialog {
26 public: 24 public:
27 ShellJavaScriptDialog( 25 ShellJavaScriptDialog(
28 ShellJavaScriptDialogCreator* creator, 26 ShellJavaScriptDialogCreator* creator,
29 ui::JavascriptMessageType javascript_message_type, 27 ui::JavascriptMessageType javascript_message_type,
30 const string16& message_text, 28 const string16& message_text,
31 const string16& default_prompt_text, 29 const string16& default_prompt_text,
32 const JavaScriptDialogCreator::DialogClosedCallback& callback); 30 const JavaScriptDialogCreator::DialogClosedCallback& callback);
33 ~ShellJavaScriptDialog(); 31 ~ShellJavaScriptDialog();
34 32
35 // Called to cancel a dialog mid-flight. 33 // Called to cancel a dialog mid-flight.
36 void Cancel(); 34 void Cancel();
37 35
38 private: 36 private:
39 ShellJavaScriptDialogCreator* creator_; 37 ShellJavaScriptDialogCreator* creator_;
40 JavaScriptDialogCreator::DialogClosedCallback callback_; 38 JavaScriptDialogCreator::DialogClosedCallback callback_;
41 39
42 #if defined(OS_MACOSX) 40 #if defined(OS_MACOSX)
43 ShellJavaScriptDialogHelper* helper_; // owned 41 ShellJavaScriptDialogHelper* helper_; // owned
44 NSAlert* alert_; // weak, owned by |helper_|.
45 #elif defined(OS_WIN) 42 #elif defined(OS_WIN)
46 ui::JavascriptMessageType message_type_; 43 ui::JavascriptMessageType message_type_;
47 HWND dialog_win_; 44 HWND dialog_win_;
48 string16 message_text_; 45 string16 message_text_;
49 string16 default_prompt_text_; 46 string16 default_prompt_text_;
50 static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wparam, 47 static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wparam,
51 LPARAM lparam); 48 LPARAM lparam);
52 #endif 49 #endif
53 50
54 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialog); 51 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialog);
55 }; 52 };
56 53
57 } // namespace content 54 } // namespace content
58 55
59 #endif // CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_ 56 #endif // CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_
OLDNEW
« no previous file with comments | « no previous file | content/shell/shell_javascript_dialog_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698