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

Unified Diff: chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm

Issue 12286014: Factor out uses of WebContentsModalDialog interface functions from WebContentsModalDialogManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit test failure Created 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/constrained_window_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm b/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm
index 3dfbb0959e2ccc48f1100db20c7360670bddaad6..3a5bbbbf30db76470dbd84975caafebfb3253300 100644
--- a/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm
+++ b/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm
@@ -4,8 +4,53 @@
#include "chrome/browser/ui/web_contents_modal_dialog_manager.h"
+#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
+#include "chrome/browser/ui/native_web_contents_modal_dialog_manager.h"
+
+namespace {
+
+class NativeWebContentsModalDialogManagerCocoa
+ : public NativeWebContentsModalDialogManager {
+ public:
+ NativeWebContentsModalDialogManagerCocoa() {
+ }
+
+ virtual ~NativeWebContentsModalDialogManagerCocoa() {
+ }
+
+ // NativeWebContentsModalDialogManager overrides
+ virtual void ManageDialog(NativeWebContentsModalDialog dialog) OVERRIDE {
+ }
+
+ virtual void ShowDialog(NativeWebContentsModalDialog dialog) OVERRIDE {
+ GetConstrainedWindowMac(dialog)->ShowWebContentsModalDialog();
+ }
+
+ virtual void CloseDialog(NativeWebContentsModalDialog dialog) OVERRIDE {
+ GetConstrainedWindowMac(dialog)->CloseWebContentsModalDialog();
+ }
+
+ virtual void FocusDialog(NativeWebContentsModalDialog dialog) OVERRIDE {
+ GetConstrainedWindowMac(dialog)->FocusWebContentsModalDialog();
+ }
+
+ virtual void PulseDialog(NativeWebContentsModalDialog dialog) OVERRIDE {
+ GetConstrainedWindowMac(dialog)->PulseWebContentsModalDialog();
+ }
+
+ private:
+ static ConstrainedWindowMac* GetConstrainedWindowMac(
+ NativeWebContentsModalDialog dialog) {
+ return static_cast<ConstrainedWindowMac*>(dialog);
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(NativeWebContentsModalDialogManagerCocoa);
+};
+
+} // namespace
+
NativeWebContentsModalDialogManager*
WebContentsModalDialogManager::CreateNativeManager(
NativeWebContentsModalDialogManagerDelegate* native_delegate) {
- return NULL;
+ return new NativeWebContentsModalDialogManagerCocoa;
}
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/constrained_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698