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

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

Issue 1747803003: MacViews: Implement Tab Dragging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extract DragsWindowUsingCocoaMoveLoop test, cleanup code. Created 4 years, 9 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
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..81360557b32167347c48895e5dbce095c75bb177 100644
--- a/chrome/browser/ui/views/tabs/window_finder_mac.mm
+++ b/chrome/browser/ui/views/tabs/window_finder_mac.mm
@@ -4,9 +4,28 @@
#include "chrome/browser/ui/views/tabs/window_finder.h"
+#include <AppKit/AppKit.h>
tapted 2016/03/10 11:51:19 nit: import
themblsha 2016/03/10 17:18:58 Done.
+
+#include "ui/gfx/geometry/point.h"
+#import "ui/gfx/mac/coordinate_conversion.h"
+
gfx::NativeWindow GetLocalProcessWindowAtPoint(
const gfx::Point& screen_point,
const std::set<gfx::NativeWindow>& ignore) {
- NOTIMPLEMENTED();
- return NULL;
+ NSPoint ns_point = gfx::ScreenPointToNSPoint(screen_point);
+
+ // 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;
}

Powered by Google App Engine
This is Rietveld 408576698