| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/event_filter.h" | 5 #include "ui/aura/event_filter.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "ui/aura/desktop.h" | 9 #include "ui/aura/desktop.h" |
| 10 #include "ui/aura/event.h" | 10 #include "ui/aura/event.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 int key_event_count_; | 61 int key_event_count_; |
| 62 int mouse_event_count_; | 62 int mouse_event_count_; |
| 63 int touch_event_count_; | 63 int touch_event_count_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(TestEventFilterWindowDelegate); | 65 DISALLOW_COPY_AND_ASSIGN(TestEventFilterWindowDelegate); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 Window* CreateWindow(int id, Window* parent, WindowDelegate* delegate) { | 68 Window* CreateWindow(int id, Window* parent, WindowDelegate* delegate) { |
| 69 Window* window = new Window(delegate ? delegate : new TestWindowDelegate); | 69 Window* window = new Window(delegate ? delegate : new TestWindowDelegate); |
| 70 window->set_id(id); | 70 window->set_id(id); |
| 71 window->Init(ui::Layer::LAYER_HAS_TEXTURE); | 71 window->Init(ui::Layer::LAYER_HAS_TEXTURE, Window::LAYER_INITIALLY_INVISIBLE); |
| 72 window->SetParent(parent); | 72 window->SetParent(parent); |
| 73 window->SetBounds(gfx::Rect(0, 0, 100, 100)); | 73 window->SetBounds(gfx::Rect(0, 0, 100, 100)); |
| 74 window->Show(); | 74 window->Show(); |
| 75 return window; | 75 return window; |
| 76 } | 76 } |
| 77 | 77 |
| 78 class TestEventFilter : public EventFilter { | 78 class TestEventFilter : public EventFilter { |
| 79 public: | 79 public: |
| 80 explicit TestEventFilter(Window* owner) | 80 explicit TestEventFilter(Window* owner) |
| 81 : EventFilter(owner), | 81 : EventFilter(owner), |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 EXPECT_EQ(0, w111_filter->mouse_event_count()); | 202 EXPECT_EQ(0, w111_filter->mouse_event_count()); |
| 203 EXPECT_EQ(0, d1111->mouse_event_count()); | 203 EXPECT_EQ(0, d1111->mouse_event_count()); |
| 204 EXPECT_EQ(0, desktop_filter->touch_event_count()); | 204 EXPECT_EQ(0, desktop_filter->touch_event_count()); |
| 205 EXPECT_EQ(0, w1_filter->touch_event_count()); | 205 EXPECT_EQ(0, w1_filter->touch_event_count()); |
| 206 EXPECT_EQ(0, w111_filter->touch_event_count()); | 206 EXPECT_EQ(0, w111_filter->touch_event_count()); |
| 207 EXPECT_EQ(0, d1111->touch_event_count()); | 207 EXPECT_EQ(0, d1111->touch_event_count()); |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace test | 210 } // namespace test |
| 211 } // namespace aura | 211 } // namespace aura |
| 212 | |
| OLD | NEW |