Chromium Code Reviews| 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_CONSTRAINED_WEB_DIALOG_UI_H_ | 5 #ifndef UI_WEB_DIALOGS_CONSTRAINED_WEB_DIALOG_UI_H_ |
| 6 #define UI_WEB_DIALOGS_CONSTRAINED_WEB_DIALOG_UI_H_ | 6 #define UI_WEB_DIALOGS_CONSTRAINED_WEB_DIALOG_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "content/public/browser/web_ui_controller.h" | 10 #include "content/public/browser/web_ui_controller.h" |
| 11 #include "ui/web_dialogs/web_dialogs_export.h" | 11 #include "ui/web_dialogs/web_dialogs_export.h" |
| 12 | 12 |
| 13 class ConstrainedWindow; | 13 class ConstrainedWindow; |
| 14 class Profile; | 14 class Profile; |
| 15 class TabContents; | 15 class TabContents; |
| 16 typedef TabContents TabContentsWrapper; | |
| 17 class WebDialogWebContentsDelegate; | 16 class WebDialogWebContentsDelegate; |
| 18 | 17 |
| 19 namespace base { | 18 namespace base { |
| 20 template<class T> class PropertyAccessor; | 19 template<class T> class PropertyAccessor; |
| 21 } | 20 } |
| 22 | 21 |
| 23 namespace content { | 22 namespace content { |
| 24 class RenderViewHost; | 23 class RenderViewHost; |
| 25 } | 24 } |
| 26 | 25 |
| 27 namespace ui { | 26 namespace ui { |
| 28 class WebDialogDelegate; | 27 class WebDialogDelegate; |
| 29 | 28 |
| 30 class WEB_DIALOGS_EXPORT ConstrainedWebDialogDelegate { | 29 class WEB_DIALOGS_EXPORT ConstrainedWebDialogDelegate { |
| 31 public: | 30 public: |
| 32 virtual const WebDialogDelegate* GetWebDialogDelegate() const = 0; | 31 virtual const WebDialogDelegate* GetWebDialogDelegate() const = 0; |
| 33 virtual WebDialogDelegate* GetWebDialogDelegate() = 0; | 32 virtual WebDialogDelegate* GetWebDialogDelegate() = 0; |
| 34 | 33 |
| 35 // Called when the dialog is being closed in response to a "DialogClose" | 34 // Called when the dialog is being closed in response to a "DialogClose" |
| 36 // message from WebUI. | 35 // message from WebUI. |
| 37 virtual void OnDialogCloseFromWebUI() = 0; | 36 virtual void OnDialogCloseFromWebUI() = 0; |
| 38 | 37 |
| 39 // If called, on dialog closure, the dialog will release its WebContents | 38 // If called, on dialog closure, the dialog will release its WebContents |
| 40 // instead of destroying it. After which point, the caller will own the | 39 // instead of destroying it. After which point, the caller will own the |
| 41 // released WebContents. | 40 // released WebContents. |
| 42 virtual void ReleaseTabContentsOnDialogClose() = 0; | 41 virtual void ReleaseTabContentsOnDialogClose() = 0; |
| 43 | 42 |
| 44 // Returns the ConstrainedWindow. | 43 // Returns the ConstrainedWindow. |
| 45 virtual ConstrainedWindow* window() = 0; | 44 virtual ConstrainedWindow* window() = 0; |
|
Ben Goodger (Google)
2012/06/19 14:55:07
can you add a TODO here to fix these function name
jam
2012/06/19 15:13:28
Done.
| |
| 46 | 45 |
| 47 // Returns the TabContentsWrapper owned by the constrained window. | 46 // Returns the TabContents owned by the constrained window. |
| 48 virtual TabContentsWrapper* tab() = 0; | 47 virtual TabContents* tab() = 0; |
| 49 | 48 |
| 50 protected: | 49 protected: |
| 51 virtual ~ConstrainedWebDialogDelegate() {} | 50 virtual ~ConstrainedWebDialogDelegate() {} |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 // ConstrainedWebDialogUI is a facility to show HTML WebUI content | 53 // ConstrainedWebDialogUI is a facility to show HTML WebUI content |
| 55 // in a tab-modal constrained dialog. It is implemented as an adapter | 54 // in a tab-modal constrained dialog. It is implemented as an adapter |
| 56 // between an WebDialogUI object and a ConstrainedWindow object. | 55 // between an WebDialogUI object and a ConstrainedWindow object. |
| 57 // | 56 // |
| 58 // Since ConstrainedWindow requires platform-specific delegate | 57 // Since ConstrainedWindow requires platform-specific delegate |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 // |delegate| controls the behavior of the dialog. | 92 // |delegate| controls the behavior of the dialog. |
| 94 // |tab_delegate| is optional, pass one in to use a custom | 93 // |tab_delegate| is optional, pass one in to use a custom |
| 95 // WebDialogWebContentsDelegate with the dialog, or NULL to | 94 // WebDialogWebContentsDelegate with the dialog, or NULL to |
| 96 // use the default one. The dialog takes ownership of | 95 // use the default one. The dialog takes ownership of |
| 97 // |tab_delegate|. | 96 // |tab_delegate|. |
| 98 // |overshadowed| is the tab being overshadowed by the dialog. | 97 // |overshadowed| is the tab being overshadowed by the dialog. |
| 99 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( | 98 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( |
| 100 Profile* profile, | 99 Profile* profile, |
| 101 WebDialogDelegate* delegate, | 100 WebDialogDelegate* delegate, |
| 102 WebDialogWebContentsDelegate* tab_delegate, | 101 WebDialogWebContentsDelegate* tab_delegate, |
| 103 TabContentsWrapper* overshadowed); | 102 TabContents* overshadowed); |
| 104 | 103 |
| 105 } // namespace ui | 104 } // namespace ui |
| 106 | 105 |
| 107 #endif // UI_WEB_DIALOGS_CONSTRAINED_WEB_DIALOG_UI_H_ | 106 #endif // UI_WEB_DIALOGS_CONSTRAINED_WEB_DIALOG_UI_H_ |
| OLD | NEW |