| Index: ui/gfx/screen_mac.mm
|
| diff --git a/ui/gfx/screen_mac.mm b/ui/gfx/screen_mac.mm
|
| index 325c679209d52523ba4d7927768e52384a6d2e13..ef1a2e3218df04a1646d86e05ef735aa50ef64db 100644
|
| --- a/ui/gfx/screen_mac.mm
|
| +++ b/ui/gfx/screen_mac.mm
|
| @@ -85,7 +85,7 @@ bool Screen::IsDIPEnabled() {
|
| }
|
|
|
| // static
|
| -gfx::Point Screen::GetCursorScreenPoint() {
|
| +gfx::Point Screen::GetCursorScreenPoint(gfx::NativeView context) {
|
| NSPoint mouseLocation = [NSEvent mouseLocation];
|
| // Flip coordinates to gfx (0,0 in top-left corner) using primary screen.
|
| NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
|
| @@ -97,19 +97,20 @@ gfx::Point Screen::GetCursorScreenPoint() {
|
| gfx::Display Screen::GetDisplayNearestWindow(gfx::NativeView view) {
|
| NSWindow* window = [view window];
|
| if (!window)
|
| - return GetPrimaryDisplay();
|
| + return GetPrimaryDisplay(view);
|
| NSScreen* match_screen = [window screen];
|
| return GetDisplayForScreen(match_screen, false /* may not be primary */);
|
| }
|
|
|
| // static
|
| -gfx::Display Screen::GetDisplayMatching(const gfx::Rect& match_rect) {
|
| +gfx::Display Screen::GetDisplayMatching(
|
| + gfx::NativeView context, const gfx::Rect& match_rect) {
|
| NSScreen* match_screen = GetMatchingScreen(match_rect);
|
| return GetDisplayForScreen(match_screen, false /* may not be primary */);
|
| }
|
|
|
| // static
|
| -gfx::Display Screen::GetPrimaryDisplay() {
|
| +gfx::Display Screen::GetPrimaryDisplay(gfx::NativeView context) {
|
| // Primary display is defined as the display with the menubar,
|
| // which is always at index 0.
|
| NSScreen* primary = [[NSScreen screens] objectAtIndex:0];
|
| @@ -118,7 +119,7 @@ gfx::Display Screen::GetPrimaryDisplay() {
|
| }
|
|
|
| // static
|
| -int Screen::GetNumDisplays() {
|
| +int Screen::GetNumDisplays(gfx::NativeView context) {
|
| // Don't just return the number of online displays. It includes displays
|
| // that mirror other displays, which are not desired in the count. It's
|
| // tempting to use the count returned by CGGetActiveDisplayList, but active
|
| @@ -153,7 +154,8 @@ int Screen::GetNumDisplays() {
|
| }
|
|
|
| // static
|
| -gfx::Display Screen::GetDisplayNearestPoint(const gfx::Point& point) {
|
| +gfx::Display Screen::GetDisplayNearestPoint(
|
| + gfx::NativeView context, const gfx::Point& point) {
|
| NSPoint ns_point = NSPointFromCGPoint(point.ToCGPoint());
|
|
|
| NSArray* screens = [NSScreen screens];
|
|
|