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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
8
9 #include "ui/gfx/geometry/point.h"
10
7 gfx::NativeWindow GetLocalProcessWindowAtPoint( 11 gfx::NativeWindow GetLocalProcessWindowAtPoint(
8 chrome::HostDesktopType host_desktop_type, 12 chrome::HostDesktopType host_desktop_type,
9 const gfx::Point& screen_point, 13 const gfx::Point& screen_point,
10 const std::set<gfx::NativeWindow>& ignore) { 14 const std::set<gfx::NativeWindow>& ignore) {
11 NOTIMPLEMENTED(); 15
12 return NULL; 16 NSPoint ns_point = NSMakePoint(
17 screen_point.x(),
18 NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - screen_point.y()
19 );
20
21 // Note [NSApp orderedWindows] doesn't include NSPanels.
22 for (NSWindow* window : [NSApp orderedWindows]) {
23 if (ignore.count(window))
24 continue;
25
26 if (![window isOnActiveSpace])
27 continue;
28
29 if (NSPointInRect(ns_point, [window frame])) {
30 NSLog(@"found: %@ at %@", window, NSStringFromPoint(ns_point));
31 return window;
32 }
33 }
34
35 NSLog(@"(nothing at %@)", NSStringFromPoint(ns_point));
36 return nil;
13 } 37 }
OLDNEW
« 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