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

Side by Side Diff: chrome/browser/ui/webui/constrained_web_dialog_ui.h

Issue 754953002: Enable AutoResize for Constrained Web Dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial Created 6 years 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
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_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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698