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

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

Issue 866263008: MacViews: Unify web contents modal dialog types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ValidationMessageBubble
Patch Set: Refining and fixed tests Created 5 years, 10 months 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 6f3f2224a9ed1e4bbdadbc6a03ecb555b591512c..3048d567288bd005557e8158506ecfad142649ed 100644
--- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h
@@ -8,6 +8,7 @@
#import <Cocoa/Cocoa.h>
#include "base/mac/scoped_nsobject.h"
+#include "chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.h"
#include "components/web_modal/native_web_contents_modal_dialog.h"
namespace content {
@@ -26,20 +27,19 @@ class ConstrainedWindowMacDelegate {
// 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 {
+class ConstrainedWindowMac :
+ public WebContentsModalDialogManagerCocoa::Observer {
public:
- ConstrainedWindowMac(
- ConstrainedWindowMacDelegate* delegate,
- content::WebContents* web_contents,
- id<ConstrainedWindowSheet> sheet);
- virtual ~ConstrainedWindowMac();
-
- void ShowWebContentsModalDialog();
- // Closes the constrained window and deletes this instance.
+ ConstrainedWindowMac(ConstrainedWindowMacDelegate* delegate,
+ content::WebContents* web_contents,
+ id<ConstrainedWindowSheet> sheet);
+ ~ConstrainedWindowMac() override;
+
+ // Closes the constrained window.
void CloseWebContentsModalDialog();
- void FocusWebContentsModalDialog();
- void PulseWebContentsModalDialog();
- web_modal::NativeWebContentsModalDialog GetNativeDialog();
+
+ // WebContentsModalDialogManagerCocoa::Observer overrides.
+ void OnDialogClosing() override;
private:
ConstrainedWindowMacDelegate* delegate_; // weak, owns us.
@@ -49,8 +49,8 @@ class ConstrainedWindowMac {
base::scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_;
tapted 2015/02/26 23:34:48 is this still needed?
Andre 2015/03/02 02:55:55 Deleted.
- // This is true if the constrained window has been shown.
- bool shown_;
+ // Weak. Owned by WebContentsModalDialogManager.
+ WebContentsModalDialogManagerCocoa* native_manager_;
};
#endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_

Powered by Google App Engine
This is Rietveld 408576698