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 CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "components/web_modal/native_web_contents_modal_dialog.h" | 9 #include "components/web_modal/native_web_contents_modal_dialog.h" |
| 10 #include "content/public/browser/web_ui_controller.h" | 10 #include "content/public/browser/web_ui_controller.h" |
| 11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 12 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) | |
|
miu
2014/11/26 00:47:44
Instead of including the header, just forward-decl
apacible
2014/11/26 17:35:15
Done.
| |
| 13 #include "ui/gfx/size.h" | |
| 14 #endif | |
| 12 | 15 |
| 13 namespace content { | 16 namespace content { |
| 14 class BrowserContext; | 17 class BrowserContext; |
| 15 class RenderViewHost; | 18 class RenderViewHost; |
| 16 class WebContents; | 19 class WebContents; |
| 17 } | 20 } |
| 18 | 21 |
| 19 namespace ui { | 22 namespace ui { |
| 20 class WebDialogDelegate; | 23 class WebDialogDelegate; |
| 21 class WebDialogWebContentsDelegate; | 24 class WebDialogWebContentsDelegate; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 34 // instead of destroying it. After which point, the caller will own the | 37 // instead of destroying it. After which point, the caller will own the |
| 35 // released WebContents. | 38 // released WebContents. |
| 36 virtual void ReleaseWebContentsOnDialogClose() = 0; | 39 virtual void ReleaseWebContentsOnDialogClose() = 0; |
| 37 | 40 |
| 38 // Returns the WebContents owned by the constrained window. | 41 // Returns the WebContents owned by the constrained window. |
| 39 virtual content::WebContents* GetWebContents() = 0; | 42 virtual content::WebContents* GetWebContents() = 0; |
| 40 | 43 |
| 41 // Returns the native type used to display the dialog. | 44 // Returns the native type used to display the dialog. |
| 42 virtual web_modal::NativeWebContentsModalDialog GetNativeDialog() = 0; | 45 virtual web_modal::NativeWebContentsModalDialog GetNativeDialog() = 0; |
| 43 | 46 |
| 47 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) | |
|
miu
2014/11/26 00:47:44
This shouldn't be a part of the interface since ou
apacible
2014/11/26 17:35:15
Done.
| |
| 48 virtual void EnableAutoResize(const gfx::Size& min_size, | |
| 49 const gfx::Size& max_size) = 0; | |
| 50 #endif | |
| 51 | |
| 44 protected: | 52 protected: |
| 45 virtual ~ConstrainedWebDialogDelegate() {} | 53 virtual ~ConstrainedWebDialogDelegate() {} |
| 46 }; | 54 }; |
| 47 | 55 |
| 48 // ConstrainedWebDialogUI is a facility to show HTML WebUI content | 56 // ConstrainedWebDialogUI is a facility to show HTML WebUI content |
| 49 // in a tab-modal constrained dialog. It is implemented as an adapter | 57 // in a tab-modal constrained dialog. It is implemented as an adapter |
| 50 // between an WebDialogUI object and a web contents modal dialog. | 58 // between an WebDialogUI object and a web contents modal dialog. |
| 51 // | 59 // |
| 52 // Since the web contents modal dialog requires platform-specific delegate | 60 // Since the web contents modal dialog requires platform-specific delegate |
| 53 // implementations, this class is just a factory stub. | 61 // implementations, this class is just a factory stub. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 80 // ConstrainedWebDialogUI object. | 88 // ConstrainedWebDialogUI object. |
| 81 // |browser_context| is used to construct the constrained HTML dialog's | 89 // |browser_context| is used to construct the constrained HTML dialog's |
| 82 // WebContents. | 90 // WebContents. |
| 83 // |delegate| controls the behavior of the dialog. | 91 // |delegate| controls the behavior of the dialog. |
| 84 // |overshadowed| is the tab being overshadowed by the dialog. | 92 // |overshadowed| is the tab being overshadowed by the dialog. |
| 85 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( | 93 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( |
| 86 content::BrowserContext* browser_context, | 94 content::BrowserContext* browser_context, |
| 87 ui::WebDialogDelegate* delegate, | 95 ui::WebDialogDelegate* delegate, |
| 88 content::WebContents* overshadowed); | 96 content::WebContents* overshadowed); |
| 89 | 97 |
| 98 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) | |
|
miu
2014/11/26 00:47:44
Again, don't conditionally declare this function,
apacible
2014/11/26 17:35:15
Done.
| |
| 99 ConstrainedWebDialogDelegate* CreateConstrainedWebDialogWithAutoResize( | |
| 100 content::BrowserContext* browser_context, | |
| 101 ui::WebDialogDelegate* delegate, | |
| 102 content::WebContents* overshadowed, | |
| 103 gfx::Size min_size, | |
| 104 gfx::Size max_size); | |
| 105 #endif | |
| 106 | |
| 90 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ | 107 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ |
| OLD | NEW |