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

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: Fix for rsesek 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..e3d981edd473d5ba63b33dffd050956c2b3e3fe3 100644
--- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h
@@ -7,13 +7,11 @@
#import <Cocoa/Cocoa.h>
-#include "base/mac/scoped_nsobject.h"
-#include "components/web_modal/native_web_contents_modal_dialog.h"
-
namespace content {
class WebContents;
}
class ConstrainedWindowMac;
+class SingleWebContentsDialogManagerCocoa;
@protocol ConstrainedWindowSheet;
// A delegate for a constrained window. The delegate is notified when the
@@ -28,29 +26,25 @@ class ConstrainedWindowMacDelegate {
// should delete the instance when the window is closed.
class ConstrainedWindowMac {
public:
- ConstrainedWindowMac(
- ConstrainedWindowMacDelegate* delegate,
- content::WebContents* web_contents,
- id<ConstrainedWindowSheet> sheet);
- virtual ~ConstrainedWindowMac();
-
- void ShowWebContentsModalDialog();
- // Closes the constrained window and deletes this instance.
- void CloseWebContentsModalDialog();
- void FocusWebContentsModalDialog();
- void PulseWebContentsModalDialog();
- web_modal::NativeWebContentsModalDialog GetNativeDialog();
+ ConstrainedWindowMac(ConstrainedWindowMacDelegate* delegate,
+ content::WebContents* web_contents,
+ id<ConstrainedWindowSheet> sheet);
+ ~ConstrainedWindowMac();
- private:
- ConstrainedWindowMacDelegate* delegate_; // weak, owns us.
+ // Closes the constrained window.
+ void CloseWebContentsModalDialog();
- // The WebContents that owns and constrains this ConstrainedWindowMac. Weak.
- content::WebContents* web_contents_;
+ SingleWebContentsDialogManagerCocoa* manager() const { return manager_; }
+ void set_manager(SingleWebContentsDialogManagerCocoa* manager) {
+ manager_ = manager;
+ }
- base::scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_;
+ // Called by |manager_| when the dialog is closing.
+ void OnDialogClosing();
- // This is true if the constrained window has been shown.
- bool shown_;
+ private:
+ ConstrainedWindowMacDelegate* delegate_; // weak, owns us.
+ SingleWebContentsDialogManagerCocoa* manager_; // weak, owned by WCMDM.
};
#endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_

Powered by Google App Engine
This is Rietveld 408576698