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/wm/core/compound_event_filter.h" | 5 #include "ui/wm/core/compound_event_filter.h" |
6 | 6 |
7 #include "ui/aura/client/cursor_client.h" | 7 #include "ui/aura/client/cursor_client.h" |
8 #include "ui/aura/env.h" | 8 #include "ui/aura/env.h" |
9 #include "ui/aura/test/aura_test_base.h" | 9 #include "ui/aura/test/aura_test_base.h" |
10 #include "ui/aura/test/test_cursor_client.h" | 10 #include "ui/aura/test/test_cursor_client.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 namespace { | 32 namespace { |
33 | 33 |
34 // An event filter that consumes all gesture events. | 34 // An event filter that consumes all gesture events. |
35 class ConsumeGestureEventFilter : public ui::EventHandler { | 35 class ConsumeGestureEventFilter : public ui::EventHandler { |
36 public: | 36 public: |
37 ConsumeGestureEventFilter() {} | 37 ConsumeGestureEventFilter() {} |
38 virtual ~ConsumeGestureEventFilter() {} | 38 virtual ~ConsumeGestureEventFilter() {} |
39 | 39 |
40 private: | 40 private: |
41 // Overridden from ui::EventHandler: | 41 // Overridden from ui::EventHandler: |
42 virtual void OnGestureEvent(ui::GestureEvent* e) OVERRIDE { | 42 virtual void OnGestureEvent(ui::GestureEvent* e) override { |
43 e->StopPropagation(); | 43 e->StopPropagation(); |
44 } | 44 } |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(ConsumeGestureEventFilter); | 46 DISALLOW_COPY_AND_ASSIGN(ConsumeGestureEventFilter); |
47 }; | 47 }; |
48 | 48 |
49 } // namespace | 49 } // namespace |
50 | 50 |
51 typedef aura::test::AuraTestBase CompoundEventFilterTest; | 51 typedef aura::test::AuraTestBase CompoundEventFilterTest; |
52 | 52 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 241 |
242 mouse0.set_flags(mouse0.flags() & ~ui::EF_FROM_TOUCH); | 242 mouse0.set_flags(mouse0.flags() & ~ui::EF_FROM_TOUCH); |
243 DispatchEventUsingWindowDispatcher(&mouse0); | 243 DispatchEventUsingWindowDispatcher(&mouse0); |
244 EXPECT_TRUE(cursor_client.IsMouseEventsEnabled()); | 244 EXPECT_TRUE(cursor_client.IsMouseEventsEnabled()); |
245 | 245 |
246 aura::Env::GetInstance()->RemovePreTargetHandler(compound_filter.get()); | 246 aura::Env::GetInstance()->RemovePreTargetHandler(compound_filter.get()); |
247 } | 247 } |
248 #endif | 248 #endif |
249 | 249 |
250 } // namespace wm | 250 } // namespace wm |
OLD | NEW |