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

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: Fix include. Created 4 years, 6 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_interactive_uitest.cc ('k') | chrome/chrome_tests.gypi » ('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 8c1a344f1348ac4adbdf94bd1358c51bd3ca2dab..ab9555d42730303a2c8a3134672462b72c5c3544 100644
--- a/chrome/browser/ui/views/tabs/window_finder_mac.mm
+++ b/chrome/browser/ui/views/tabs/window_finder_mac.mm
@@ -4,9 +4,32 @@
#include "chrome/browser/ui/views/tabs/window_finder.h"
+#import <AppKit/AppKit.h>
+
+#include "ui/gfx/geometry/point.h"
+#import "ui/gfx/mac/coordinate_conversion.h"
+
gfx::NativeWindow WindowFinder::GetLocalProcessWindowAtPoint(
const gfx::Point& screen_point,
const std::set<gfx::NativeWindow>& ignore) {
- NOTIMPLEMENTED();
- return NULL;
+ const 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;
+
+ // NativeWidgetMac::Close() calls -orderOut: on NSWindows before actually
+ // closing them.
+ if (![window isVisible])
+ continue;
+
+ if (NSPointInRect(ns_point, [window frame]))
+ return window;
+ }
+
+ return nil;
}
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698