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

Side by Side Diff: chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h

Issue 10451047: content: Move javascript_message_type.h into content/ from ui/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm CONTEXT_EXPORT Created 8 years, 6 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 | chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc » ('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 CHROME_BROWSER_UI_APP_MODAL_DIALOGS_JAVASCRIPT_APP_MODAL_DIALOG_H_ 5 #ifndef CHROME_BROWSER_UI_APP_MODAL_DIALOGS_JAVASCRIPT_APP_MODAL_DIALOG_H_
6 #define CHROME_BROWSER_UI_APP_MODAL_DIALOGS_JAVASCRIPT_APP_MODAL_DIALOG_H_ 6 #define CHROME_BROWSER_UI_APP_MODAL_DIALOGS_JAVASCRIPT_APP_MODAL_DIALOG_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 14 matching lines...) Expand all
25 }; 25 };
26 26
27 // A controller + model class for JavaScript alert, confirm, prompt, and 27 // A controller + model class for JavaScript alert, confirm, prompt, and
28 // onbeforeunload dialog boxes. 28 // onbeforeunload dialog boxes.
29 class JavaScriptAppModalDialog : public AppModalDialog { 29 class JavaScriptAppModalDialog : public AppModalDialog {
30 public: 30 public:
31 JavaScriptAppModalDialog( 31 JavaScriptAppModalDialog(
32 content::WebContents* web_contents, 32 content::WebContents* web_contents,
33 ChromeJavaScriptDialogExtraData* extra_data, 33 ChromeJavaScriptDialogExtraData* extra_data,
34 const string16& title, 34 const string16& title,
35 ui::JavascriptMessageType javascript_message_type, 35 content::JavaScriptMessageType javascript_message_type,
36 const string16& message_text, 36 const string16& message_text,
37 const string16& default_prompt_text, 37 const string16& default_prompt_text,
38 bool display_suppress_checkbox, 38 bool display_suppress_checkbox,
39 bool is_before_unload_dialog, 39 bool is_before_unload_dialog,
40 bool is_reload, 40 bool is_reload,
41 const content::JavaScriptDialogCreator::DialogClosedCallback& callback); 41 const content::JavaScriptDialogCreator::DialogClosedCallback& callback);
42 virtual ~JavaScriptAppModalDialog(); 42 virtual ~JavaScriptAppModalDialog();
43 43
44 // Overridden from AppModalDialog: 44 // Overridden from AppModalDialog:
45 virtual NativeAppModalDialog* CreateNativeDialog() OVERRIDE; 45 virtual NativeAppModalDialog* CreateNativeDialog() OVERRIDE;
46 virtual bool IsJavaScriptModalDialog() OVERRIDE; 46 virtual bool IsJavaScriptModalDialog() OVERRIDE;
47 virtual void Invalidate() OVERRIDE; 47 virtual void Invalidate() OVERRIDE;
48 48
49 // Callbacks from NativeDialog when the user accepts or cancels the dialog. 49 // Callbacks from NativeDialog when the user accepts or cancels the dialog.
50 void OnCancel(bool suppress_js_messages); 50 void OnCancel(bool suppress_js_messages);
51 void OnAccept(const string16& prompt_text, bool suppress_js_messages); 51 void OnAccept(const string16& prompt_text, bool suppress_js_messages);
52 52
53 // NOTE: This is only called under Views, and should be removed. Any critical 53 // NOTE: This is only called under Views, and should be removed. Any critical
54 // work should be done in OnCancel or OnAccept. See crbug.com/63732 for more. 54 // work should be done in OnCancel or OnAccept. See crbug.com/63732 for more.
55 void OnClose(); 55 void OnClose();
56 56
57 // Used only for testing. The dialog will use the given text when notifying 57 // Used only for testing. The dialog will use the given text when notifying
58 // its delegate instead of whatever the UI reports. 58 // its delegate instead of whatever the UI reports.
59 void SetOverridePromptText(const string16& prompt_text); 59 void SetOverridePromptText(const string16& prompt_text);
60 60
61 // Accessors 61 // Accessors
62 ui::JavascriptMessageType javascript_message_type() const { 62 content::JavaScriptMessageType javascript_message_type() const {
63 return javascript_message_type_; 63 return javascript_message_type_;
64 } 64 }
65 string16 message_text() const { return message_text_; } 65 string16 message_text() const { return message_text_; }
66 string16 default_prompt_text() const { return default_prompt_text_; } 66 string16 default_prompt_text() const { return default_prompt_text_; }
67 bool display_suppress_checkbox() const { return display_suppress_checkbox_; } 67 bool display_suppress_checkbox() const { return display_suppress_checkbox_; }
68 bool is_before_unload_dialog() const { return is_before_unload_dialog_; } 68 bool is_before_unload_dialog() const { return is_before_unload_dialog_; }
69 bool is_reload() const { return is_reload_; } 69 bool is_reload() const { return is_reload_; }
70 70
71 private: 71 private:
72 // Notifies the delegate with the result of the dialog. 72 // Notifies the delegate with the result of the dialog.
73 void NotifyDelegate(bool success, const string16& prompt_text, 73 void NotifyDelegate(bool success, const string16& prompt_text,
74 bool suppress_js_messages); 74 bool suppress_js_messages);
75 75
76 // The extra Chrome-only data associated with the delegate_. 76 // The extra Chrome-only data associated with the delegate_.
77 ChromeJavaScriptDialogExtraData* extra_data_; 77 ChromeJavaScriptDialogExtraData* extra_data_;
78 78
79 // Information about the message box is held in the following variables. 79 // Information about the message box is held in the following variables.
80 const ui::JavascriptMessageType javascript_message_type_; 80 const content::JavaScriptMessageType javascript_message_type_;
81 string16 message_text_; 81 string16 message_text_;
82 string16 default_prompt_text_; 82 string16 default_prompt_text_;
83 bool display_suppress_checkbox_; 83 bool display_suppress_checkbox_;
84 bool is_before_unload_dialog_; 84 bool is_before_unload_dialog_;
85 bool is_reload_; 85 bool is_reload_;
86 86
87 content::JavaScriptDialogCreator::DialogClosedCallback callback_; 87 content::JavaScriptDialogCreator::DialogClosedCallback callback_;
88 88
89 // Used only for testing. Specifies alternative prompt text that should be 89 // Used only for testing. Specifies alternative prompt text that should be
90 // used when notifying the delegate, if |use_override_prompt_text_| is true. 90 // used when notifying the delegate, if |use_override_prompt_text_| is true.
91 string16 override_prompt_text_; 91 string16 override_prompt_text_;
92 bool use_override_prompt_text_; 92 bool use_override_prompt_text_;
93 93
94 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialog); 94 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialog);
95 }; 95 };
96 96
97 #endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_JAVASCRIPT_APP_MODAL_DIALOG_H_ 97 #endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_JAVASCRIPT_APP_MODAL_DIALOG_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698