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 UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ | 5 #ifndef UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ |
6 #define UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ | 6 #define UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // |render_view_host| is the RenderViewHost for the shown dialog. | 72 // |render_view_host| is the RenderViewHost for the shown dialog. |
73 virtual void OnDialogShown(content::WebUI* webui, | 73 virtual void OnDialogShown(content::WebUI* webui, |
74 content::RenderViewHost* render_view_host) {} | 74 content::RenderViewHost* render_view_host) {} |
75 | 75 |
76 // A callback to notify the delegate that the dialog closed. | 76 // A callback to notify the delegate that the dialog closed. |
77 // IMPORTANT: Implementations should delete |this| here (unless they've | 77 // IMPORTANT: Implementations should delete |this| here (unless they've |
78 // arranged for the delegate to be deleted in some other way, e.g. by | 78 // arranged for the delegate to be deleted in some other way, e.g. by |
79 // registering it as a message handler in the WebUI object). | 79 // registering it as a message handler in the WebUI object). |
80 virtual void OnDialogClosed(const std::string& json_retval) = 0; | 80 virtual void OnDialogClosed(const std::string& json_retval) = 0; |
81 | 81 |
| 82 // A callback to notify the delegate that the dialog is being closed in |
| 83 // response to a "DialogClose" message from WebUI. |
| 84 virtual void OnDialogCloseFromWebUI(const std::string& json_retval); |
| 85 |
82 // A callback to notify the delegate that the contents have gone | 86 // A callback to notify the delegate that the contents have gone |
83 // away. Only relevant if your dialog hosts code that calls | 87 // away. Only relevant if your dialog hosts code that calls |
84 // windows.close() and you've allowed that. If the output parameter | 88 // windows.close() and you've allowed that. If the output parameter |
85 // is set to true, then the dialog is closed. The default is false. | 89 // is set to true, then the dialog is closed. The default is false. |
86 virtual void OnCloseContents(content::WebContents* source, | 90 virtual void OnCloseContents(content::WebContents* source, |
87 bool* out_close_dialog) = 0; | 91 bool* out_close_dialog) = 0; |
88 | 92 |
89 // A callback to allow the delegate to dictate that the window should not | 93 // A callback to allow the delegate to dictate that the window should not |
90 // have a title bar. This is useful when presenting branded interfaces. | 94 // have a title bar. This is useful when presenting branded interfaces. |
91 virtual bool ShouldShowDialogTitle() const = 0; | 95 virtual bool ShouldShowDialogTitle() const = 0; |
(...skipping 24 matching lines...) Expand all Loading... |
116 | 120 |
117 // Stores the dialog bounds. | 121 // Stores the dialog bounds. |
118 virtual void StoreDialogSize(const gfx::Size& dialog_size) {} | 122 virtual void StoreDialogSize(const gfx::Size& dialog_size) {} |
119 | 123 |
120 virtual ~WebDialogDelegate() {} | 124 virtual ~WebDialogDelegate() {} |
121 }; | 125 }; |
122 | 126 |
123 } // namespace ui | 127 } // namespace ui |
124 | 128 |
125 #endif // UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ | 129 #endif // UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ |
OLD | NEW |