Chromium Code Reviews| Index: chrome/browser/ui/views/frame/browser_frame_mac.mm |
| diff --git a/chrome/browser/ui/views/frame/browser_frame_mac.mm b/chrome/browser/ui/views/frame/browser_frame_mac.mm |
| index 2d9aa266b431e81973ffbcc22024616e104a8b70..7b8f6c1e3d0c531978d145d8cc426718261a308e 100644 |
| --- a/chrome/browser/ui/views/frame/browser_frame_mac.mm |
| +++ b/chrome/browser/ui/views/frame/browser_frame_mac.mm |
| @@ -8,6 +8,7 @@ |
| #include "chrome/browser/ui/views/frame/browser_shutdown.h" |
| #include "chrome/browser/ui/views/frame/browser_view.h" |
| #import "chrome/browser/ui/views/frame/native_widget_mac_frameless_nswindow.h" |
| +#include "components/web_modal/web_contents_modal_dialog_host.h" |
| #import "ui/base/cocoa/window_size_constants.h" |
| BrowserFrameMac::BrowserFrameMac(BrowserFrame* browser_frame, |
| @@ -29,6 +30,15 @@ void BrowserFrameMac::OnWindowWillClose() { |
| NativeWidgetMac::OnWindowWillClose(); |
| } |
| +int BrowserFrameMac::SheetPositionY() { |
| + web_modal::WebContentsModalDialogHost* dialog_host = |
| + browser_view_->GetWebContentsModalDialogHost(); |
| + NSView* host_view = dialog_host->GetHostView(); |
|
tapted
2015/08/26 03:20:41
I think I need a comment about the logic here.
E.
jackhou1
2015/08/26 07:02:09
Done.
|
| + int host_view_y = |
| + NSHeight([[host_view window] frame]) - NSMaxY([host_view frame]); |
| + return host_view_y + dialog_host->GetDialogPosition(gfx::Size()).y(); |
| +} |
| + |
| void BrowserFrameMac::InitNativeWidget( |
| const views::Widget::InitParams& params) { |
| views::NativeWidgetMac::InitNativeWidget(params); |