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

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: per miu's comments 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 12
13 namespace gfx {
14 class Size;
Bernhard Bauer 2014/11/27 12:41:34 Don't indent inside of namespaces.
apacible 2014/12/01 17:35:57 Done.
15 }
16
13 namespace content { 17 namespace content {
14 class BrowserContext; 18 class BrowserContext;
15 class RenderViewHost; 19 class RenderViewHost;
16 class WebContents; 20 class WebContents;
17 } 21 }
18 22
19 namespace ui { 23 namespace ui {
20 class WebDialogDelegate; 24 class WebDialogDelegate;
21 class WebDialogWebContentsDelegate; 25 class WebDialogWebContentsDelegate;
22 } 26 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // Returns NULL if no such delegate is set. 72 // Returns NULL if no such delegate is set.
69 ConstrainedWebDialogDelegate* GetConstrainedDelegate(); 73 ConstrainedWebDialogDelegate* GetConstrainedDelegate();
70 74
71 private: 75 private:
72 // JS Message Handler 76 // JS Message Handler
73 void OnDialogCloseMessage(const base::ListValue* args); 77 void OnDialogCloseMessage(const base::ListValue* args);
74 78
75 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogUI); 79 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogUI);
76 }; 80 };
77 81
78 // Create a constrained HTML dialog. The actual object that gets created 82 // Create and show a constrained HTML dialog. The actual object that gets
79 // is a ConstrainedWebDialogDelegate, which later triggers construction of a 83 // created is a ConstrainedWebDialogDelegate, which later triggers construction
80 // ConstrainedWebDialogUI object. 84 // of a ConstrainedWebDialogUI object.
81 // |browser_context| is used to construct the constrained HTML dialog's 85 // |browser_context| is used to construct the constrained HTML dialog's
82 // WebContents. 86 // WebContents.
83 // |delegate| controls the behavior of the dialog. 87 // |delegate| controls the behavior of the dialog.
84 // |overshadowed| is the tab being overshadowed by the dialog. 88 // |overshadowed| is the tab being overshadowed by the dialog.
85 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( 89 ConstrainedWebDialogDelegate* ShowConstrainedWebDialog(
86 content::BrowserContext* browser_context, 90 content::BrowserContext* browser_context,
87 ui::WebDialogDelegate* delegate, 91 ui::WebDialogDelegate* delegate,
88 content::WebContents* overshadowed); 92 content::WebContents* overshadowed);
89 93
94 // Creates a constrained HTML dialog with auto-resize enabled. The dialog
Bernhard Bauer 2014/11/27 12:41:34 Nit: Either use imperative style ("create") like a
apacible 2014/12/01 17:35:57 Done.
95 // is shown by calling constrained_window::ShowModalDialogViews() after
96 // document load has completed to avoid UI jankiness.
97 // |browser_context| is used to construct the constrained HTML dialog's
98 // WebContents.
99 // |delegate| controls the behavior of the dialog.
100 // |overshadowed| is the tab being overshadowed by the dialog.
101 // |min_size| is the minimum size of the dialog.
102 // |max_size| is the maximum size of the dialog.
103 ConstrainedWebDialogDelegate* CreateConstrainedWebDialogWithAutoResize(
104 content::BrowserContext* browser_context,
105 ui::WebDialogDelegate* delegate,
106 content::WebContents* overshadowed,
107 gfx::Size min_size,
108 gfx::Size max_size);
109
90 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ 110 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698