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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/tabs/window_finder.h" 5 #include "chrome/browser/ui/views/tabs/window_finder.h"
6 6
7 #include <AppKit/AppKit.h>
tapted 2016/03/10 11:51:19 nit: import
themblsha 2016/03/10 17:18:58 Done.
8
9 #include "ui/gfx/geometry/point.h"
10 #import "ui/gfx/mac/coordinate_conversion.h"
11
7 gfx::NativeWindow GetLocalProcessWindowAtPoint( 12 gfx::NativeWindow GetLocalProcessWindowAtPoint(
8 const gfx::Point& screen_point, 13 const gfx::Point& screen_point,
9 const std::set<gfx::NativeWindow>& ignore) { 14 const std::set<gfx::NativeWindow>& ignore) {
10 NOTIMPLEMENTED(); 15 NSPoint ns_point = gfx::ScreenPointToNSPoint(screen_point);
11 return NULL; 16
17 // Note [NSApp orderedWindows] doesn't include NSPanels.
18 for (NSWindow* window : [NSApp orderedWindows]) {
19 if (ignore.count(window))
20 continue;
21
22 if (![window isOnActiveSpace])
23 continue;
24
25 if (NSPointInRect(ns_point, [window frame])) {
26 return window;
27 }
28 }
29
30 return nil;
12 } 31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698