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..5285ebbdda4c21b849e6b9a7809e1103143ddf62 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,17 @@ void BrowserFrameMac::OnWindowWillClose() { |
NativeWidgetMac::OnWindowWillClose(); |
} |
+int BrowserFrameMac::SheetPositionY() { |
+ web_modal::WebContentsModalDialogHost* dialog_host = |
+ browser_view_->GetWebContentsModalDialogHost(); |
+ NSView* view = dialog_host->GetHostView(); |
+ // Get the position of the host view relative to the window since |
+ // ModalDialogHost::GetDialogPosition() is relative to the host view. |
+ int host_view_y = |
+ [view convertPoint:NSMakePoint(0, NSHeight([view frame])) toView:nil].y; |
+ return host_view_y - dialog_host->GetDialogPosition(gfx::Size()).y(); |
+} |
+ |
void BrowserFrameMac::InitNativeWidget( |
const views::Widget::InitParams& params) { |
views::NativeWidgetMac::InitNativeWidget(params); |