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

Unified Diff: chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.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/web_contents_modal_dialog_manager_cocoa.h
diff --git a/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.h b/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef87a6756d7da823f3665c0c0aad7bb9048b6557
--- /dev/null
+++ b/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.h
@@ -0,0 +1,50 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_MODAL_DIALOG_MANAGER_COCOA_H_
+#define CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_MODAL_DIALOG_MANAGER_COCOA_H_
+
+#include "base/mac/scoped_nsobject.h"
tapted 2015/02/26 23:34:49 nit: import
Andre 2015/03/02 02:55:56 Done.
+#include "base/observer_list.h"
+#include "components/web_modal/single_web_contents_dialog_manager.h"
+
+@protocol ConstrainedWindowSheet;
+
+class WebContentsModalDialogManagerCocoa
tapted 2015/02/26 23:34:49 It's a mouthful, but perhaps prefix with 'Single'.
Andre 2015/03/02 02:55:56 Done.
+ : public web_modal::SingleWebContentsDialogManager {
+ public:
+ WebContentsModalDialogManagerCocoa(
+ id<ConstrainedWindowSheet> sheet,
+ web_modal::SingleWebContentsDialogManagerDelegate* delegate);
+ ~WebContentsModalDialogManagerCocoa() override;
+
+ class Observer {
+ public:
+ virtual ~Observer() {}
+ virtual void OnDialogClosing() = 0; // Called when the dialog is closing.
+ };
+
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
+ // SingleWebContentsDialogManager overrides.
+ void Show() override;
+ void Hide() override;
+ void Close() override;
+ void Focus() override;
+ void Pulse() override;
+ void HostChanged(web_modal::WebContentsModalDialogHost* new_host) override;
+ web_modal::NativeWebContentsModalDialog dialog() override;
+
+ private:
+ base::scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_;
+ // Weak. Owns this.
+ web_modal::SingleWebContentsDialogManagerDelegate* delegate_;
+ ObserverList<Observer> observers_;
+ bool shown_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogManagerCocoa);
+};
+
+#endif // CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_MODAL_DIALOG_MANAGER_COCOA_H_

Powered by Google App Engine
This is Rietveld 408576698