diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-09 19:01:12 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-09 19:01:12 +0000 |
commit | 023424e03760080f4ae54c3643e80dce51490ab2 (patch) | |
tree | 33bdbf6d3c6666aeaba366b2d1278237daa2c01e /views | |
parent | 5cf8a5b6283f30685a063a52efd9800cf23ab1f6 (diff) | |
download | chromium_src-023424e03760080f4ae54c3643e80dce51490ab2.zip chromium_src-023424e03760080f4ae54c3643e80dce51490ab2.tar.gz chromium_src-023424e03760080f4ae54c3643e80dce51490ab2.tar.bz2 |
Add check for window on view in MouseObserver
BUG=chromium-os:12119
TEST=None
Review URL: http://codereview.chromium.org/6612039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77492 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/mouse_watcher.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/views/mouse_watcher.cc b/views/mouse_watcher.cc index c535f14..990e2f5 100644 --- a/views/mouse_watcher.cc +++ b/views/mouse_watcher.cc @@ -96,8 +96,12 @@ class MouseWatcher::Observer : public MessageLoopForUI::Observer { // Returns true if the mouse is over the view's window. bool IsMouseOverWindow() { + Window* window = view()->GetWindow(); + if (!window) + return false; + return Screen::GetWindowAtCursorScreenPoint() == - view()->GetWindow()->GetNativeWindow(); + window->GetNativeWindow(); } // Called from the message loop observer when a mouse movement has occurred. |