| 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/display/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 |
| 11 namespace views { | 11 namespace views { |
| 12 | 12 |
| 13 MouseWatcherViewHost::MouseWatcherViewHost(View* view, | 13 MouseWatcherViewHost::MouseWatcherViewHost(View* view, |
| 14 const gfx::Insets& hot_zone_insets) | 14 const gfx::Insets& hot_zone_insets) |
| 15 : view_(view), | 15 : view_(view), |
| 16 hot_zone_insets_(hot_zone_insets) { | 16 hot_zone_insets_(hot_zone_insets) { |
| 17 } | 17 } |
| (...skipping 24 matching lines...) Expand all 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::GetScreen()->GetWindowUnderCursor() == | 52 return display::Screen::GetScreen()->GetWindowUnderCursor() == |
| 53 widget->GetNativeWindow(); | 53 widget->GetNativeWindow(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace views | 56 } // namespace views |
| OLD | NEW |