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

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

Issue 10834079: views: Extract Widget observer into its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/system/web_notification/web_notification_tray.cc ('k') | ash/wm/app_list_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #ifndef ASH_TOUCH_TOUCH_OBSERVER_HUD_H_ 5 #ifndef ASH_TOUCH_TOUCH_OBSERVER_HUD_H_
6 #define ASH_TOUCH_TOUCH_OBSERVER_HUD_H_ 6 #define ASH_TOUCH_TOUCH_OBSERVER_HUD_H_
7 7
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ui/aura/event_filter.h" 9 #include "ui/aura/event_filter.h"
10 #include "ui/gfx/point.h" 10 #include "ui/gfx/point.h"
11 #include "ui/views/widget/widget.h" 11 #include "ui/views/widget/widget_observer.h"
12 12
13 namespace aura { 13 namespace aura {
14 class MouseEvent; 14 class MouseEvent;
15 class KeyEvent; 15 class KeyEvent;
16 class Window; 16 class Window;
17 } 17 }
18 18
19 namespace views { 19 namespace views {
20 class Label; 20 class Label;
21 class Widget; 21 class Widget;
22 } 22 }
23 23
24 namespace ash { 24 namespace ash {
25 namespace internal { 25 namespace internal {
26 26
27 class TouchHudCanvas; 27 class TouchHudCanvas;
28 28
29 // An event filter which handles system level gesture events. 29 // An event filter which handles system level gesture events.
30 class TouchObserverHUD : public aura::EventFilter, 30 class TouchObserverHUD : public aura::EventFilter,
31 public views::Widget::Observer { 31 public views::WidgetObserver {
32 public: 32 public:
33 TouchObserverHUD(); 33 TouchObserverHUD();
34 virtual ~TouchObserverHUD(); 34 virtual ~TouchObserverHUD();
35 35
36 private: 36 private:
37 void UpdateTouchPointLabel(int index); 37 void UpdateTouchPointLabel(int index);
38 38
39 // Overriden from aura::EventFilter: 39 // Overriden from aura::EventFilter:
40 virtual bool PreHandleKeyEvent(aura::Window* target, 40 virtual bool PreHandleKeyEvent(aura::Window* target,
41 aura::KeyEvent* event) OVERRIDE; 41 aura::KeyEvent* event) OVERRIDE;
42 virtual bool PreHandleMouseEvent(aura::Window* target, 42 virtual bool PreHandleMouseEvent(aura::Window* target,
43 aura::MouseEvent* event) OVERRIDE; 43 aura::MouseEvent* event) OVERRIDE;
44 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target, 44 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target,
45 aura::TouchEvent* event) OVERRIDE; 45 aura::TouchEvent* event) OVERRIDE;
46 virtual ui::GestureStatus PreHandleGestureEvent( 46 virtual ui::GestureStatus PreHandleGestureEvent(
47 aura::Window* target, 47 aura::Window* target,
48 aura::GestureEvent* event) OVERRIDE; 48 aura::GestureEvent* event) OVERRIDE;
49 49
50 // Overridden from views::Widget::Observer. 50 // Overridden from views::WidgetObserver:
51 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; 51 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
52 52
53 static const int kMaxTouchPoints = 32; 53 static const int kMaxTouchPoints = 32;
54 54
55 views::Widget* widget_; 55 views::Widget* widget_;
56 TouchHudCanvas* canvas_; 56 TouchHudCanvas* canvas_;
57 views::Label* touch_labels_[kMaxTouchPoints]; 57 views::Label* touch_labels_[kMaxTouchPoints];
58 gfx::Point touch_positions_[kMaxTouchPoints]; 58 gfx::Point touch_positions_[kMaxTouchPoints];
59 ui::EventType touch_status_[kMaxTouchPoints]; 59 ui::EventType touch_status_[kMaxTouchPoints];
60 60
61 DISALLOW_COPY_AND_ASSIGN(TouchObserverHUD); 61 DISALLOW_COPY_AND_ASSIGN(TouchObserverHUD);
62 }; 62 };
63 63
64 } // namespace internal 64 } // namespace internal
65 } // namespace ash 65 } // namespace ash
66 66
67 #endif // ASH_TOUCH_TOUCH_OBSERVER_HUD_H_ 67 #endif // ASH_TOUCH_TOUCH_OBSERVER_HUD_H_
OLDNEW
« no previous file with comments | « ash/system/web_notification/web_notification_tray.cc ('k') | ash/wm/app_list_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698