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

Unified Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h

Issue 1430023002: Enable AutoResize for Constrained Web Dialogs for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h
diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h
index e3d981edd473d5ba63b33dffd050956c2b3e3fe3..f2a0ed0c39db01fe1771108bbe359621aabb2988 100644
--- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h
@@ -7,6 +7,8 @@
#import <Cocoa/Cocoa.h>
+#include "components/web_modal/web_contents_modal_dialog_manager.h"
+
namespace content {
class WebContents;
}
@@ -21,16 +23,33 @@ class ConstrainedWindowMacDelegate {
virtual void OnConstrainedWindowClosed(ConstrainedWindowMac* window) = 0;
};
+// Creates a ConstrainedWindowMac, shows the dialog, and returns it.
+ConstrainedWindowMac* ShowWebModalDialogMac(
erikchen 2015/11/11 21:22:30 s/Show/CreateAndShow/
apacible 2015/11/12 02:02:24 Done.
+ ConstrainedWindowMacDelegate* delegate,
+ content::WebContents* web_contents,
+ id<ConstrainedWindowSheet> sheet);
+
+// Creates a ConstrainedWindowMac and returns it.
+ConstrainedWindowMac* CreateWebModalDialogMac(
+ ConstrainedWindowMacDelegate* delegate,
+ content::WebContents* web_contents,
+ id<ConstrainedWindowSheet> sheet);
+
// Constrained window implementation for Mac.
// Normally an instance of this class is owned by the delegate. The delegate
// should delete the instance when the window is closed.
class ConstrainedWindowMac {
public:
+ ConstrainedWindowMac(ConstrainedWindowMacDelegate* delegate);
erikchen 2015/11/11 21:22:30 explicit
apacible 2015/11/12 02:02:24 Done.
ConstrainedWindowMac(ConstrainedWindowMacDelegate* delegate,
content::WebContents* web_contents,
id<ConstrainedWindowSheet> sheet);
erikchen 2015/11/11 21:22:30 The public interface for ConstrainedWindowMac is c
apacible 2015/11/12 02:02:24 Cleaned up: - Back to one constructor. - One ShowD
~ConstrainedWindowMac();
+ void ShowDialog(content::WebContents* web_contents,
+ id<ConstrainedWindowSheet> sheet);
+ void ShowDialog();
+
// Closes the constrained window.
void CloseWebContentsModalDialog();
@@ -38,6 +57,7 @@ class ConstrainedWindowMac {
void set_manager(SingleWebContentsDialogManagerCocoa* manager) {
manager_ = manager;
}
+ id<ConstrainedWindowSheet> sheet() const { return sheet_; }
// Called by |manager_| when the dialog is closing.
void OnDialogClosing();
@@ -45,6 +65,10 @@ class ConstrainedWindowMac {
private:
ConstrainedWindowMacDelegate* delegate_; // weak, owns us.
SingleWebContentsDialogManagerCocoa* manager_; // weak, owned by WCMDM.
+
+ id<ConstrainedWindowSheet> sheet_;
erikchen 2015/11/11 21:22:30 What are the expected/required lifetime semantics
apacible 2015/11/12 02:02:24 Ownership should be passed to the WebContentsModal
+ scoped_ptr<SingleWebContentsDialogManagerCocoa> native_manager_;
+ web_modal::WebContentsModalDialogManager* dialog_manager_;
erikchen 2015/11/11 21:22:30 What are you expected/required lifetime semantics
apacible 2015/11/12 02:02:24 Correct, it's tied to web_contents. Updated to dyn
};
#endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_

Powered by Google App Engine
This is Rietveld 408576698