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

Unified Diff: ash/touch/touch_observer_hud.h

Issue 17063013: Separate projection mode from rest of touch HUD (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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/touch/touch_hud_projection.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
index d1c65eba62befc8b3f051bd6ee3ba787961fa0a4..850bc5e92026d48469704e2427e3eab6264d81a5 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();
+ // Called to clear touch points and traces from the screen. Default
+ // implementation does nothing. Sub-classes should implement appropriately.
+ virtual void Clear();
- // Changes the display mode (e.g. scale, visibility). Calling this repeatedly
- // cycles between a fixed number of display modes.
- void ChangeToNextMode();
+ // Removes the HUD from the screen.
+ void Remove();
- // Removes all existing touch points from the screen (only if the HUD is
- // visible).
- void Clear();
+ int64 display_id() const { return display_id_; }
- // 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;
-
- Mode mode() const { return mode_; }
-
- private:
- friend class TouchHudTest;
+ protected:
+ explicit TouchObserverHUD(aura::RootWindow* initial_root);
virtual ~TouchObserverHUD();
- void SetMode(Mode mode);
+ virtual void SetHudForRootWindowController(
+ RootWindowController* controller) = 0;
+ virtual void UnsetHudForRootWindowController(
+ RootWindowController* controller) = 0;
- void UpdateTouchPointLabel(int index);
+ views::Widget* widget() { return widget_; }
- // 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;
+ private:
+ friend class TouchHudTest;
const int64 display_id_;
aura::RootWindow* root_window_;
- Mode mode_;
-
- scoped_ptr<TouchLog> touch_log_;
-
views::Widget* widget_;
- TouchHudCanvas* canvas_;
- std::map<int, TouchPointView*> points_;
- views::View* label_container_;
- views::Label* touch_labels_[kMaxTouchPoints];
DISALLOW_COPY_AND_ASSIGN(TouchObserverHUD);
};
« no previous file with comments | « ash/touch/touch_hud_projection.cc ('k') | ash/touch/touch_observer_hud.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698