OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/aura/test/window_test_api.h" | 5 #include "ui/aura/test/window_test_api.h" |
6 | 6 |
7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 #include "ui/aura/window_event_dispatcher.h" |
| 9 #include "ui/aura/window_tree_host.h" |
8 | 10 |
9 namespace aura { | 11 namespace aura { |
10 namespace test { | 12 namespace test { |
11 | 13 |
12 WindowTestApi::WindowTestApi(Window* window) : window_(window) { | 14 WindowTestApi::WindowTestApi(Window* window) : window_(window) { |
13 } | 15 } |
14 | 16 |
15 bool WindowTestApi::OwnsLayer() const { | 17 bool WindowTestApi::OwnsLayer() const { |
16 return window_->OwnsLayer(); | 18 return window_->OwnsLayer(); |
17 } | 19 } |
18 | 20 |
19 bool WindowTestApi::ContainsMouse() const { | 21 bool WindowTestApi::ContainsMouse() const { |
20 return window_->ContainsMouse(); | 22 if (!window_->IsVisible()) |
| 23 return false; |
| 24 WindowTreeHost* host = window_->GetHost(); |
| 25 return host && |
| 26 window_->ContainsPointInRoot( |
| 27 host->dispatcher()->GetLastMouseLocationInRoot()); |
21 } | 28 } |
22 | 29 |
23 } // namespace test | 30 } // namespace test |
24 } // namespace aura | 31 } // namespace aura |
OLD | NEW |