Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Side by Side Diff: ash/touch/touch_observer_hud.h

Issue 10386178: ash: Add a heads-up display to track touch-point states and positions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 void Initialize();
34
35 private:
36 void UpdateTouchPointLabel(int index);
37
38 // Overriden from aura::EventFilter:
39 virtual bool PreHandleKeyEvent(aura::Window* target,
40 aura::KeyEvent* event) OVERRIDE;
41 virtual bool PreHandleMouseEvent(aura::Window* target,
42 aura::MouseEvent* event) OVERRIDE;
43 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target,
44 aura::TouchEvent* event) OVERRIDE;
45 virtual ui::GestureStatus PreHandleGestureEvent(
46 aura::Window* target,
47 aura::GestureEvent* event) OVERRIDE;
48
49 static const int kMaxTouchPoints = 32;
50 scoped_ptr<views::Widget> widget_;
51 views::Label* touch_labels_[kMaxTouchPoints];
52 gfx::Point touch_positions_[kMaxTouchPoints];
53 ui::EventType touch_status_[kMaxTouchPoints];
54
55 DISALLOW_COPY_AND_ASSIGN(TouchObserverHUD);
56 };
57
58 } // namespace internal
59 } // namespace ash
60
61 #endif // ASH_TOUCH_TOUCH_OBSERVER_HUD_H_
OLDNEW
« ash/shell.cc ('K') | « ash/shell.cc ('k') | ash/touch/touch_observer_hud.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698