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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.cc ('k') | ash/touch/touch_observer_hud.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/touch/touch_observer_hud.h
diff --git a/ash/touch/touch_observer_hud.h b/ash/touch/touch_observer_hud.h
new file mode 100644
index 0000000000000000000000000000000000000000..3da6a5624530d0877b1b9356c8c8979bab85d034
--- /dev/null
+++ b/ash/touch/touch_observer_hud.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_TOUCH_TOUCH_OBSERVER_HUD_H_
+#define ASH_TOUCH_TOUCH_OBSERVER_HUD_H_
+#pragma once
+
+#include "ash/shell.h"
+#include "ui/aura/event_filter.h"
+#include "ui/gfx/point.h"
+
+namespace aura {
+class MouseEvent;
+class KeyEvent;
+class Window;
+}
+
+namespace views {
+class Label;
+class Widget;
+}
+
+namespace ash {
+namespace internal {
+
+// An event filter which handles system level gesture events.
+class TouchObserverHUD : public aura::EventFilter {
+ public:
+ TouchObserverHUD();
+ virtual ~TouchObserverHUD();
+
+ private:
+ void UpdateTouchPointLabel(int index);
+
+ // Overriden from aura::EventFilter:
+ virtual bool PreHandleKeyEvent(aura::Window* target,
+ aura::KeyEvent* event) OVERRIDE;
+ virtual bool PreHandleMouseEvent(aura::Window* target,
+ aura::MouseEvent* event) OVERRIDE;
+ virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target,
+ aura::TouchEvent* event) OVERRIDE;
+ virtual ui::GestureStatus PreHandleGestureEvent(
+ aura::Window* target,
+ aura::GestureEvent* event) OVERRIDE;
+
+ static const int kMaxTouchPoints = 32;
+ scoped_ptr<views::Widget> widget_;
+ views::Label* touch_labels_[kMaxTouchPoints];
+ gfx::Point touch_positions_[kMaxTouchPoints];
+ ui::EventType touch_status_[kMaxTouchPoints];
+
+ DISALLOW_COPY_AND_ASSIGN(TouchObserverHUD);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_TOUCH_TOUCH_OBSERVER_HUD_H_
« 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