| OLD | NEW |
| 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/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
| 10 #include "ui/events/event_handler.h" | 10 #include "ui/events/event_handler.h" |
| 11 #include "ui/gfx/display_observer.h" | 11 #include "ui/gfx/display_observer.h" |
| 12 #include "ui/views/widget/widget_observer.h" | 12 #include "ui/views/widget/widget_observer.h" |
| 13 | 13 |
| 14 #if defined(OS_CHROMEOS) | 14 #if defined(OS_CHROMEOS) |
| 15 #include "chromeos/display/output_configurator.h" | 15 #include "ui/display/chromeos/output_configurator.h" |
| 16 #endif // defined(OS_CHROMEOS) | 16 #endif // defined(OS_CHROMEOS) |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 class Widget; | 19 class Widget; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace ash { | 22 namespace ash { |
| 23 namespace internal { | 23 namespace internal { |
| 24 | 24 |
| 25 // An event filter which handles system level gesture events. Objects of this | 25 // An event filter which handles system level gesture events. Objects of this |
| 26 // class manage their own lifetime. | 26 // class manage their own lifetime. |
| 27 class ASH_EXPORT TouchObserverHUD | 27 class ASH_EXPORT TouchObserverHUD : public ui::EventHandler, |
| 28 : public ui::EventHandler, | 28 public views::WidgetObserver, |
| 29 public views::WidgetObserver, | 29 public gfx::DisplayObserver, |
| 30 public gfx::DisplayObserver, | |
| 31 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
| 32 public chromeos::OutputConfigurator::Observer, | 31 public ui::OutputConfigurator::Observer, |
| 33 #endif // defined(OS_CHROMEOS) | 32 #endif // defined(OS_CHROMEOS) |
| 34 public DisplayController::Observer { | 33 public DisplayController::Observer { |
| 35 public: | 34 public: |
| 36 // Called to clear touch points and traces from the screen. Default | 35 // Called to clear touch points and traces from the screen. Default |
| 37 // implementation does nothing. Sub-classes should implement appropriately. | 36 // implementation does nothing. Sub-classes should implement appropriately. |
| 38 virtual void Clear(); | 37 virtual void Clear(); |
| 39 | 38 |
| 40 // Removes the HUD from the screen. | 39 // Removes the HUD from the screen. |
| 41 void Remove(); | 40 void Remove(); |
| 42 | 41 |
| 43 int64 display_id() const { return display_id_; } | 42 int64 display_id() const { return display_id_; } |
| 44 | 43 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 59 | 58 |
| 60 // Overridden from views::WidgetObserver. | 59 // Overridden from views::WidgetObserver. |
| 61 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 60 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
| 62 | 61 |
| 63 // Overridden from gfx::DisplayObserver. | 62 // Overridden from gfx::DisplayObserver. |
| 64 virtual void OnDisplayBoundsChanged(const gfx::Display& display) OVERRIDE; | 63 virtual void OnDisplayBoundsChanged(const gfx::Display& display) OVERRIDE; |
| 65 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; | 64 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; |
| 66 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; | 65 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; |
| 67 | 66 |
| 68 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
| 69 // Overriden from chromeos::OutputConfigurator::Observer. | 68 // Overriden from ui::OutputConfigurator::Observer. |
| 70 virtual void OnDisplayModeChanged( | 69 virtual void OnDisplayModeChanged(const std::vector< |
| 71 const std::vector<chromeos::OutputConfigurator::OutputSnapshot>& outputs) | 70 ui::OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE; |
| 72 OVERRIDE; | |
| 73 #endif // defined(OS_CHROMEOS) | 71 #endif // defined(OS_CHROMEOS) |
| 74 | 72 |
| 75 // Overriden form DisplayController::Observer. | 73 // Overriden form DisplayController::Observer. |
| 76 virtual void OnDisplayConfigurationChanging() OVERRIDE; | 74 virtual void OnDisplayConfigurationChanging() OVERRIDE; |
| 77 virtual void OnDisplayConfigurationChanged() OVERRIDE; | 75 virtual void OnDisplayConfigurationChanged() OVERRIDE; |
| 78 | 76 |
| 79 private: | 77 private: |
| 80 friend class TouchHudTestBase; | 78 friend class TouchHudTestBase; |
| 81 | 79 |
| 82 const int64 display_id_; | 80 const int64 display_id_; |
| 83 aura::Window* root_window_; | 81 aura::Window* root_window_; |
| 84 | 82 |
| 85 views::Widget* widget_; | 83 views::Widget* widget_; |
| 86 | 84 |
| 87 DISALLOW_COPY_AND_ASSIGN(TouchObserverHUD); | 85 DISALLOW_COPY_AND_ASSIGN(TouchObserverHUD); |
| 88 }; | 86 }; |
| 89 | 87 |
| 90 } // namespace internal | 88 } // namespace internal |
| 91 } // namespace ash | 89 } // namespace ash |
| 92 | 90 |
| 93 #endif // ASH_TOUCH_TOUCH_OBSERVER_HUD_H_ | 91 #endif // ASH_TOUCH_TOUCH_OBSERVER_HUD_H_ |
| OLD | NEW |