Chromium Code Reviews| Index: ash/touch/touch_observer_hud.h |
| diff --git a/ash/touch/touch_observer_hud.h b/ash/touch/touch_observer_hud.h |
| index d1c65eba62befc8b3f051bd6ee3ba787961fa0a4..e54cc3bd941eab510809e79602217e529f6149ab 100644 |
| --- a/ash/touch/touch_observer_hud.h |
| +++ b/ash/touch/touch_observer_hud.h |
| @@ -5,43 +5,23 @@ |
| #ifndef ASH_TOUCH_TOUCH_OBSERVER_HUD_H_ |
| #define ASH_TOUCH_TOUCH_OBSERVER_HUD_H_ |
| -#include <map> |
| - |
| #include "ash/ash_export.h" |
| #include "ash/display/display_controller.h" |
| -#include "ash/shell.h" |
| -#include "base/memory/scoped_ptr.h" |
| -#include "base/values.h" |
| #include "ui/base/events/event_handler.h" |
| #include "ui/gfx/display_observer.h" |
| -#include "ui/gfx/point.h" |
| #include "ui/views/widget/widget_observer.h" |
| #if defined(OS_CHROMEOS) |
| #include "chromeos/display/output_configurator.h" |
| #endif // defined(OS_CHROMEOS) |
| -namespace aura { |
| -class Window; |
| -} |
| - |
| -namespace gfx { |
| -class Display; |
| -} |
| - |
| namespace views { |
| -class Label; |
| -class View; |
| class Widget; |
| } |
| namespace ash { |
| namespace internal { |
| -class TouchHudCanvas; |
| -class TouchLog; |
| -class TouchPointView; |
| - |
| // An event filter which handles system level gesture events. Objects of this |
| // class manage their own lifetime. |
| class ASH_EXPORT TouchObserverHUD |
| @@ -53,76 +33,54 @@ class ASH_EXPORT TouchObserverHUD |
| #endif // defined(OS_CHROMEOS) |
| public DisplayController::Observer { |
| public: |
| - enum Mode { |
| - FULLSCREEN, |
| - REDUCED_SCALE, |
| - PROJECTION, |
| - INVISIBLE, |
| - }; |
| - |
| - explicit TouchObserverHUD(aura::RootWindow* initial_root); |
| - |
| - // Returns the log of touch events as a dictionary mapping id of each display |
| - // to its touch log. |
| - static scoped_ptr<DictionaryValue> GetAllAsDictionary(); |
| - |
| - // Changes the display mode (e.g. scale, visibility). Calling this repeatedly |
| - // cycles between a fixed number of display modes. |
| - void ChangeToNextMode(); |
| - |
| - // Removes all existing touch points from the screen (only if the HUD is |
| - // visible). |
| - void Clear(); |
| + // Called to clear touch points and traces from the screen. Default |
| + // implementation does nothing. Sub-classes should implement appropriately. |
| + virtual void Clear(); |
| - // Returns log of touch events as a list value. Each item in the list is a |
| - // trace of one touch point. |
| - scoped_ptr<ListValue> GetLogAsList() const; |
| + // Removes the HUD from the screen. |
| + void Remove(); |
| - Mode mode() const { return mode_; } |
| + int64 display_id() const { return display_id_; } |
| - private: |
| - friend class TouchHudTest; |
| + protected: |
| + explicit TouchObserverHUD(aura::RootWindow* initial_root); |
| virtual ~TouchObserverHUD(); |
| - void SetMode(Mode mode); |
| - |
| - void UpdateTouchPointLabel(int index); |
| - |
| - // Overriden from ui::EventHandler: |
| + // Overriden from ui::EventHandler. |
| virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; |
| - // Overridden from views::WidgetObserver: |
| + // Overridden from views::WidgetObserver. |
| virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
| - // Overridden from gfx::DisplayObserver: |
| + // Overridden from gfx::DisplayObserver. |
| virtual void OnDisplayBoundsChanged(const gfx::Display& display) OVERRIDE; |
| virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; |
| virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; |
| #if defined(OS_CHROMEOS) |
| - // Overriden from chromeos::OutputConfigurator::Observer: |
| + // Overriden from chromeos::OutputConfigurator::Observer. |
| virtual void OnDisplayModeChanged() OVERRIDE; |
| #endif // defined(OS_CHROMEOS) |
| - // Overriden form DisplayController::Observer: |
| + // Overriden form DisplayController::Observer. |
| virtual void OnDisplayConfigurationChanging() OVERRIDE; |
| virtual void OnDisplayConfigurationChanged() OVERRIDE; |
| - static const int kMaxTouchPoints = 32; |
| + virtual void SetHudForRootWindowController( |
|
sadrul
2013/06/26 17:26:21
Doc. Move these above the overridden methods
mohsen
2013/06/26 19:15:49
Done.
|
| + RootWindowController* controller) = 0; |
| + virtual void UnsetHudForRootWindowController( |
| + RootWindowController* controller) = 0; |
| - const int64 display_id_; |
| - aura::RootWindow* root_window_; |
| + views::Widget* widget() { return widget_; } |
| - Mode mode_; |
| + private: |
| + friend class TouchHudTest; |
| - scoped_ptr<TouchLog> touch_log_; |
| + const int64 display_id_; |
| + aura::RootWindow* root_window_; |
| views::Widget* widget_; |
| - TouchHudCanvas* canvas_; |
| - std::map<int, TouchPointView*> points_; |
| - views::View* label_container_; |
| - views::Label* touch_labels_[kMaxTouchPoints]; |
| DISALLOW_COPY_AND_ASSIGN(TouchObserverHUD); |
| }; |