OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_TOUCH_TOUCH_OBSERVER_HUD_H_ | |
6 #define ASH_TOUCH_TOUCH_OBSERVER_HUD_H_ | |
7 #pragma once | |
8 | |
9 #include "ash/shell.h" | |
10 #include "ui/aura/event_filter.h" | |
11 #include "ui/gfx/point.h" | |
12 | |
13 namespace aura { | |
14 class MouseEvent; | |
15 class KeyEvent; | |
16 class Window; | |
17 } | |
18 | |
19 namespace views { | |
20 class Label; | |
21 class Widget; | |
22 } | |
23 | |
24 namespace ash { | |
25 namespace internal { | |
26 | |
27 // An event filter which handles system level gesture events. | |
28 class TouchObserverHUD : public aura::EventFilter { | |
29 public: | |
30 TouchObserverHUD(); | |
31 virtual ~TouchObserverHUD(); | |
32 | |
33 private: | |
34 void UpdateTouchPointLabel(int index); | |
35 | |
36 // Overriden from aura::EventFilter: | |
37 virtual bool PreHandleKeyEvent(aura::Window* target, | |
38 aura::KeyEvent* event) OVERRIDE; | |
39 virtual bool PreHandleMouseEvent(aura::Window* target, | |
40 aura::MouseEvent* event) OVERRIDE; | |
41 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target, | |
42 aura::TouchEvent* event) OVERRIDE; | |
43 virtual ui::GestureStatus PreHandleGestureEvent( | |
44 aura::Window* target, | |
45 aura::GestureEvent* event) OVERRIDE; | |
46 | |
47 static const int kMaxTouchPoints = 32; | |
48 scoped_ptr<views::Widget> widget_; | |
49 views::Label* touch_labels_[kMaxTouchPoints]; | |
50 gfx::Point touch_positions_[kMaxTouchPoints]; | |
51 ui::EventType touch_status_[kMaxTouchPoints]; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(TouchObserverHUD); | |
54 }; | |
55 | |
56 } // namespace internal | |
57 } // namespace ash | |
58 | |
59 #endif // ASH_TOUCH_TOUCH_OBSERVER_HUD_H_ | |
OLD | NEW |