| Index: chrome/browser/ui/views/tabs/window_finder_mac.mm
|
| diff --git a/chrome/browser/ui/views/tabs/window_finder_mac.mm b/chrome/browser/ui/views/tabs/window_finder_mac.mm
|
| index 8bc230359792bc2905eca9296c1a57ffcc0570e1..595f1ef77e180bee2d3265b7129d628cbc0ff24e 100644
|
| --- a/chrome/browser/ui/views/tabs/window_finder_mac.mm
|
| +++ b/chrome/browser/ui/views/tabs/window_finder_mac.mm
|
| @@ -4,9 +4,29 @@
|
|
|
| #include "chrome/browser/ui/views/tabs/window_finder.h"
|
|
|
| +#include <AppKit/AppKit.h>
|
| +
|
| +#include "ui/gfx/geometry/point.h"
|
| +
|
| gfx::NativeWindow GetLocalProcessWindowAtPoint(
|
| const gfx::Point& screen_point,
|
| const std::set<gfx::NativeWindow>& ignore) {
|
| - NOTIMPLEMENTED();
|
| - return NULL;
|
| + NSPoint ns_point = NSMakePoint(
|
| + screen_point.x(),
|
| + NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - screen_point.y());
|
| +
|
| + // Note [NSApp orderedWindows] doesn't include NSPanels.
|
| + for (NSWindow* window : [NSApp orderedWindows]) {
|
| + if (ignore.count(window))
|
| + continue;
|
| +
|
| + if (![window isOnActiveSpace])
|
| + continue;
|
| +
|
| + if (NSPointInRect(ns_point, [window frame])) {
|
| + return window;
|
| + }
|
| + }
|
| +
|
| + return nil;
|
| }
|
|
|