| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
| 9 #include "ui/views/test/widget_test.h" | 9 #include "ui/views/test/widget_test.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 widget2.SetCapture(widget2.GetRootView()); | 769 widget2.SetCapture(widget2.GetRootView()); |
| 770 EXPECT_FALSE(widget1.HasCapture()); | 770 EXPECT_FALSE(widget1.HasCapture()); |
| 771 EXPECT_TRUE(widget2.HasCapture()); | 771 EXPECT_TRUE(widget2.HasCapture()); |
| 772 | 772 |
| 773 widget1.GetAndClearGotMouseEvent(); | 773 widget1.GetAndClearGotMouseEvent(); |
| 774 widget2.GetAndClearGotMouseEvent(); | 774 widget2.GetAndClearGotMouseEvent(); |
| 775 // Send a mouse event to the RootWindow associated with |widget1|. Even though | 775 // Send a mouse event to the RootWindow associated with |widget1|. Even though |
| 776 // |widget2| has capture, |widget1| should still get the event. | 776 // |widget2| has capture, |widget1| should still get the event. |
| 777 ui::MouseEvent mouse_event(ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), | 777 ui::MouseEvent mouse_event(ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), |
| 778 ui::EF_NONE); | 778 ui::EF_NONE); |
| 779 widget1.GetNativeWindow()->GetDispatcher()->AsWindowTreeHostDelegate()-> | 779 widget1.GetNativeWindow()->GetDispatcher()->AsRootWindowHostDelegate()-> |
| 780 OnHostMouseEvent(&mouse_event); | 780 OnHostMouseEvent(&mouse_event); |
| 781 EXPECT_TRUE(widget1.GetAndClearGotMouseEvent()); | 781 EXPECT_TRUE(widget1.GetAndClearGotMouseEvent()); |
| 782 EXPECT_FALSE(widget2.GetAndClearGotMouseEvent()); | 782 EXPECT_FALSE(widget2.GetAndClearGotMouseEvent()); |
| 783 } | 783 } |
| 784 #endif | 784 #endif |
| 785 | 785 |
| 786 } // namespace test | 786 } // namespace test |
| 787 } // namespace views | 787 } // namespace views |
| OLD | NEW |