Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4039)

Unified Diff: chrome/browser/ui/views/tabs/window_finder_mac.mm

Issue 1259913003: MacViews: Implement Tab Dragging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150529-ViewsBrowser-DisableCertificateDialog
Patch Set: update comments, still a TODO Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller.cc ('k') | ui/events/cocoa/events_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b2307da3550759fb0f79b3c117b8571fdc6fef0b..06e9843b5ac00fdb85faf557cb6538f43a09ce74 100644
--- a/chrome/browser/ui/views/tabs/window_finder_mac.mm
+++ b/chrome/browser/ui/views/tabs/window_finder_mac.mm
@@ -4,10 +4,34 @@
#include "chrome/browser/ui/views/tabs/window_finder.h"
+#include <AppKit/AppKit.h>
+
+#include "ui/gfx/geometry/point.h"
+
gfx::NativeWindow GetLocalProcessWindowAtPoint(
chrome::HostDesktopType host_desktop_type,
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])) {
+ NSLog(@"found: %@ at %@", window, NSStringFromPoint(ns_point));
+ return window;
+ }
+ }
+
+ NSLog(@"(nothing at %@)", NSStringFromPoint(ns_point));
+ return nil;
}
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller.cc ('k') | ui/events/cocoa/events_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698