Commit 38a801fc authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

content: implement WebContentsViewMac::GetViewBounds

This method is needed for positioning the find bar in Views browser mode.

Bug: 834754
Change-Id: Id984e5281bf970c0c99af8696a6cebbb8ca4c2a3
Reviewed-on: https://chromium-review.googlesource.com/1028450Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553740}
parent 5497b84e
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "skia/ext/skia_utils_mac.h" #include "skia/ext/skia_utils_mac.h"
#import "third_party/mozilla/NSPasteboard+Utils.h" #import "third_party/mozilla/NSPasteboard+Utils.h"
#include "ui/base/clipboard/custom_data_helper.h" #include "ui/base/clipboard/custom_data_helper.h"
#include "ui/base/cocoa/cocoa_base_utils.h"
#include "ui/base/dragdrop/cocoa_dnd_util.h" #include "ui/base/dragdrop/cocoa_dnd_util.h"
#include "ui/display/screen.h" #include "ui/display/screen.h"
#include "ui/gfx/image/image_skia_util_mac.h" #include "ui/gfx/image/image_skia_util_mac.h"
...@@ -317,9 +318,11 @@ void WebContentsViewMac::OnMenuClosed() { ...@@ -317,9 +318,11 @@ void WebContentsViewMac::OnMenuClosed() {
} }
gfx::Rect WebContentsViewMac::GetViewBounds() const { gfx::Rect WebContentsViewMac::GetViewBounds() const {
// This method is not currently used on mac. NSRect window_bounds =
NOTIMPLEMENTED(); [cocoa_view_ convertRect:[cocoa_view_ bounds] toView:nil];
return gfx::Rect(); window_bounds.origin = ui::ConvertPointFromWindowToScreen(
[cocoa_view_ window], window_bounds.origin);
return gfx::ScreenRectFromNSRect(window_bounds);
} }
void WebContentsViewMac::SetAllowOtherViews(bool allow) { void WebContentsViewMac::SetAllowOtherViews(bool allow) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment