| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 // Gets the JSON string input to use when showing the dialog. | 63 // Gets the JSON string input to use when showing the dialog. |
| 64 virtual std::string GetDialogArgs() const = 0; | 64 virtual std::string GetDialogArgs() const = 0; |
| 65 | 65 |
| 66 // Returns true to signal that the dialog can be closed. Specialized | 66 // Returns true to signal that the dialog can be closed. Specialized |
| 67 // WebDialogDelegate subclasses can override this default behavior to allow | 67 // WebDialogDelegate subclasses can override this default behavior to allow |
| 68 // the close to be blocked until the user corrects mistakes, accepts an | 68 // the close to be blocked until the user corrects mistakes, accepts an |
| 69 // agreement, etc. | 69 // agreement, etc. |
| 70 virtual bool CanCloseDialog() const; | 70 virtual bool CanCloseDialog() const; |
| 71 | 71 |
| 72 // Returns true if the dialog can ever be resized. Default implementation |
| 73 // returns |true|. |
| 74 virtual bool CanResizeDialog() const; |
| 75 |
| 72 // A callback to notify the delegate that |source|'s loading state has | 76 // A callback to notify the delegate that |source|'s loading state has |
| 73 // changed. | 77 // changed. |
| 74 virtual void OnLoadingStateChanged(content::WebContents* source) {} | 78 virtual void OnLoadingStateChanged(content::WebContents* source) {} |
| 75 | 79 |
| 76 // A callback to notify the delegate that a web dialog has been shown. | 80 // A callback to notify the delegate that a web dialog has been shown. |
| 77 // |webui| is the WebUI with which the dialog is associated. | 81 // |webui| is the WebUI with which the dialog is associated. |
| 78 // |render_view_host| is the RenderViewHost for the shown dialog. | 82 // |render_view_host| is the RenderViewHost for the shown dialog. |
| 79 virtual void OnDialogShown(content::WebUI* webui, | 83 virtual void OnDialogShown(content::WebUI* webui, |
| 80 content::RenderViewHost* render_view_host) {} | 84 content::RenderViewHost* render_view_host) {} |
| 81 | 85 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 130 |
| 127 // Stores the dialog bounds. | 131 // Stores the dialog bounds. |
| 128 virtual void StoreDialogSize(const gfx::Size& dialog_size) {} | 132 virtual void StoreDialogSize(const gfx::Size& dialog_size) {} |
| 129 | 133 |
| 130 virtual ~WebDialogDelegate() {} | 134 virtual ~WebDialogDelegate() {} |
| 131 }; | 135 }; |
| 132 | 136 |
| 133 } // namespace ui | 137 } // namespace ui |
| 134 | 138 |
| 135 #endif // UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ | 139 #endif // UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ |
| OLD | NEW |