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

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: fix clang/win-aura 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
« no previous file with comments | « ash/shell.cc ('k') | ash/touch/touch_observer_hud.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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_
OLDNEW
« no previous file with comments | « 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