OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/mouse_watcher_view_host.h" | 5 #include "ui/views/mouse_watcher_view_host.h" |
6 | 6 |
7 #include "ui/gfx/screen.h" | 7 #include "ui/gfx/screen.h" |
8 #include "ui/views/view.h" | 8 #include "ui/views/view.h" |
9 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 return bounds.Contains(screen_point.x(), screen_point.y()); | 43 return bounds.Contains(screen_point.x(), screen_point.y()); |
44 } | 44 } |
45 | 45 |
46 // Returns true if the mouse is over the view's window. | 46 // Returns true if the mouse is over the view's window. |
47 bool MouseWatcherViewHost::IsMouseOverWindow() { | 47 bool MouseWatcherViewHost::IsMouseOverWindow() { |
48 Widget* widget = view_->GetWidget(); | 48 Widget* widget = view_->GetWidget(); |
49 if (!widget) | 49 if (!widget) |
50 return false; | 50 return false; |
51 | 51 |
52 return gfx::Screen::GetScreenFor(widget->GetNativeView())-> | 52 return gfx::Screen::GetScreen()->GetWindowUnderCursor() == |
53 GetWindowUnderCursor() == widget->GetNativeWindow(); | 53 widget->GetNativeWindow(); |
54 } | 54 } |
55 | 55 |
56 } // namespace views | 56 } // namespace views |
OLD | NEW |