| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" | 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_wi
ndow.h" | 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_wi
ndow.h" |
| 11 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" | 11 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" |
| 12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialo
g_sheet.h" | 12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialo
g_sheet.h" |
| 13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 14 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 15 #include "ui/web_dialogs/web_dialog_delegate.h" | 15 #include "ui/web_dialogs/web_dialog_delegate.h" |
| 16 #include "ui/web_dialogs/web_dialog_ui.h" | 16 #include "ui/web_dialogs/web_dialog_ui.h" |
| 17 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" | 17 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" |
| 18 | 18 |
| 19 using content::WebContents; | 19 using content::WebContents; |
| 20 using ui::WebDialogDelegate; | 20 using ui::WebDialogDelegate; |
| 21 using ui::WebDialogWebContentsDelegate; | 21 using ui::WebDialogWebContentsDelegate; |
| 22 using web_modal::NativeWebContentsModalDialog; | |
| 23 | 22 |
| 24 namespace { | 23 namespace { |
| 25 | 24 |
| 26 class ConstrainedWebDialogDelegateMac | 25 class ConstrainedWebDialogDelegateMac |
| 27 : public ConstrainedWebDialogDelegateBase { | 26 : public ConstrainedWebDialogDelegateBase { |
| 28 public: | 27 public: |
| 29 ConstrainedWebDialogDelegateMac( | 28 ConstrainedWebDialogDelegateMac( |
| 30 content::BrowserContext* browser_context, | 29 content::BrowserContext* browser_context, |
| 31 WebDialogDelegate* delegate) | 30 WebDialogDelegate* delegate) |
| 32 : ConstrainedWebDialogDelegateBase(browser_context, delegate, NULL) {} | 31 : ConstrainedWebDialogDelegateBase(browser_context, delegate, NULL) {} |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 64 } |
| 66 WebDialogDelegate* GetWebDialogDelegate() override { | 65 WebDialogDelegate* GetWebDialogDelegate() override { |
| 67 return impl_->GetWebDialogDelegate(); | 66 return impl_->GetWebDialogDelegate(); |
| 68 } | 67 } |
| 69 void OnDialogCloseFromWebUI() override { | 68 void OnDialogCloseFromWebUI() override { |
| 70 return impl_->OnDialogCloseFromWebUI(); | 69 return impl_->OnDialogCloseFromWebUI(); |
| 71 } | 70 } |
| 72 void ReleaseWebContentsOnDialogClose() override { | 71 void ReleaseWebContentsOnDialogClose() override { |
| 73 return impl_->ReleaseWebContentsOnDialogClose(); | 72 return impl_->ReleaseWebContentsOnDialogClose(); |
| 74 } | 73 } |
| 75 NativeWebContentsModalDialog GetNativeDialog() override { return window_; } | 74 gfx::NativeWindow GetNativeDialog() override { return window_; } |
| 76 WebContents* GetWebContents() override { return impl_->GetWebContents(); } | 75 WebContents* GetWebContents() override { return impl_->GetWebContents(); } |
| 77 gfx::Size GetMinimumSize() const override { | 76 gfx::Size GetMinimumSize() const override { |
| 78 NOTIMPLEMENTED(); | 77 NOTIMPLEMENTED(); |
| 79 return gfx::Size(); | 78 return gfx::Size(); |
| 80 } | 79 } |
| 81 gfx::Size GetMaximumSize() const override { | 80 gfx::Size GetMaximumSize() const override { |
| 82 NOTIMPLEMENTED(); | 81 NOTIMPLEMENTED(); |
| 83 return gfx::Size(); | 82 return gfx::Size(); |
| 84 } | 83 } |
| 85 gfx::Size GetPreferredSize() const override { | 84 gfx::Size GetPreferredSize() const override { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 ConstrainedWebDialogDelegate* ShowConstrainedWebDialog( | 130 ConstrainedWebDialogDelegate* ShowConstrainedWebDialog( |
| 132 content::BrowserContext* browser_context, | 131 content::BrowserContext* browser_context, |
| 133 WebDialogDelegate* delegate, | 132 WebDialogDelegate* delegate, |
| 134 content::WebContents* web_contents) { | 133 content::WebContents* web_contents) { |
| 135 // Deleted when the dialog closes. | 134 // Deleted when the dialog closes. |
| 136 ConstrainedWebDialogDelegateViewMac* constrained_delegate = | 135 ConstrainedWebDialogDelegateViewMac* constrained_delegate = |
| 137 new ConstrainedWebDialogDelegateViewMac( | 136 new ConstrainedWebDialogDelegateViewMac( |
| 138 browser_context, delegate, web_contents); | 137 browser_context, delegate, web_contents); |
| 139 return constrained_delegate; | 138 return constrained_delegate; |
| 140 } | 139 } |
| OLD | NEW |