Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_VIEWS_MOUSE_WATCHER_VIEW_HOST_H_ | |
| 6 #define UI_VIEWS_MOUSE_WATCHER_VIEW_HOST_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "ui/views/mouse_watcher.h" | |
| 10 | |
| 11 namespace views { | |
| 12 | |
| 13 class View; | |
| 14 | |
| 15 class VIEWS_EXPORT MouseWatcherViewHost : public MouseWatcherHost { | |
| 16 public: | |
| 17 // Creates a new MouseWatcherViewHost. |hot_zone_insets| is added to the | |
| 18 // bounds of the view to determine the active zone. For example, if | |
| 19 // |hot_zone_insets.bottom()| is 10, then the listener is not notified if | |
| 20 // the y coordinate is between the origin of the view and height of the view | |
| 21 // plus 10. | |
| 22 MouseWatcherViewHost(View* view, const gfx::Insets& hot_zone_insets); | |
| 23 virtual ~MouseWatcherViewHost(); | |
| 24 | |
| 25 // MouseWatcherHost. | |
| 26 virtual bool Contains(const gfx::Point& screen_point, MouseEventType type); | |
|
sky
2012/02/06 16:03:34
OVERRIDE
DaveMoore
2012/02/06 17:10:16
Done.
| |
| 27 | |
| 28 private: | |
| 29 bool IsCursorInViewZone(const gfx::Point& screen_point); | |
| 30 bool IsMouseOverWindow(); | |
| 31 | |
| 32 // View we're listening for events over. | |
| 33 View* view_; | |
| 34 // Insets added to the bounds of the view. | |
| 35 const gfx::Insets hot_zone_insets_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(MouseWatcherViewHost); | |
| 38 }; | |
| 39 | |
| 40 } // namespace views | |
| 41 | |
| 42 #endif // UI_VIEWS_MOUSE_WATCHER_VIEW_HOST_H_ | |
| OLD | NEW |