Index: ash/wm/overview/window_selector.h |
diff --git a/ash/wm/overview/window_selector.h b/ash/wm/overview/window_selector.h |
index bb4757c18f5537bca4b0cb371e937e9c290a67be..9356b13ddaf7891e2e73b04c71e74a027fdc4180 100644 |
--- a/ash/wm/overview/window_selector.h |
+++ b/ash/wm/overview/window_selector.h |
@@ -14,25 +14,42 @@ |
#include "base/memory/scoped_vector.h" |
#include "base/time/time.h" |
#include "ui/aura/window_observer.h" |
+#include "ui/aura/window_tracker.h" |
+#include "ui/events/event_handler.h" |
+#include "ui/gfx/display_observer.h" |
#include "ui/wm/public/activation_change_observer.h" |
namespace aura { |
class RootWindow; |
+class Window; |
+namespace client { |
+class CursorClient; |
+} // namespace client |
+} // namespace aura |
+ |
+namespace gfx { |
+class Rect; |
+} |
+ |
+namespace ui { |
+class LocatedEvent; |
} |
namespace ash { |
-class WindowOverview; |
class WindowSelectorDelegate; |
class WindowSelectorItem; |
class WindowSelectorTest; |
-// The WindowSelector allows selecting a window by clicking or tapping on it |
-// (entering Overview Mode). |
+// The WindowSelector shows a grid of all of your windows, allowing to select |
+// one by clicking or tapping on it. |
class ASH_EXPORT WindowSelector |
- : public aura::WindowObserver, |
+ : public ui::EventHandler, |
+ public gfx::DisplayObserver, |
+ public aura::WindowObserver, |
public aura::client::ActivationChangeObserver { |
public: |
typedef std::vector<aura::Window*> WindowList; |
+ typedef ScopedVector<WindowSelectorItem> WindowSelectorItemList; |
WindowSelector(const WindowList& windows, |
WindowSelectorDelegate* delegate); |
@@ -44,6 +61,17 @@ class ASH_EXPORT WindowSelector |
// Cancels window selection. |
void CancelSelection(); |
+ // ui::EventHandler: |
+ virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; |
+ virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; |
+ virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; |
+ virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; |
+ |
+ // gfx::DisplayObserver: |
+ virtual void OnDisplayBoundsChanged(const gfx::Display& display) OVERRIDE; |
+ virtual void OnDisplayAdded(const gfx::Display& display) OVERRIDE; |
+ virtual void OnDisplayRemoved(const gfx::Display& display) OVERRIDE; |
+ |
// aura::WindowObserver: |
virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE; |
virtual void OnWindowBoundsChanged(aura::Window* window, |
@@ -51,7 +79,7 @@ class ASH_EXPORT WindowSelector |
const gfx::Rect& new_bounds) OVERRIDE; |
virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
- // Overridden from aura::client::ActivationChangeObserver: |
+ // aura::client::ActivationChangeObserver: |
virtual void OnWindowActivated(aura::Window* gained_active, |
aura::Window* lost_active) OVERRIDE; |
virtual void OnAttemptToReactivateWindow( |
@@ -64,10 +92,26 @@ class ASH_EXPORT WindowSelector |
// Begins positioning windows such that all windows are visible on the screen. |
void StartOverview(); |
+ // Position all of the windows based on the current selection mode. |
+ void PositionWindows(bool animate); |
+ // Position all of the windows from |root_window| on |root_window|. |
+ void PositionWindowsFromRoot(aura::Window* root_window, bool animate); |
+ |
// Resets the stored window from RemoveFocusAndSetRestoreWindow to NULL. If |
+ // Hide and track all hidden windows not in overview. |
+ void HideAndTrackNonOverviewWindows(); |
+ |
// |focus|, restores focus to the stored window. |
void ResetFocusRestoreWindow(bool focus); |
+ // Returns the target of |event| or NULL if the event is not targeted at |
+ // any of the windows in the selector. |
+ aura::Window* GetEventTarget(ui::LocatedEvent* event); |
+ |
+ // Returns the top-level window selected by targeting |window| or NULL if |
+ // no overview window was found for |window|. |
+ aura::Window* GetTargetedWindow(aura::Window* window); |
+ |
// The collection of items in the overview wrapped by a helper class which |
// restores their state and helps transform them to other root windows. |
ScopedVector<WindowSelectorItem> windows_; |
@@ -75,8 +119,6 @@ class ASH_EXPORT WindowSelector |
// Tracks observed windows. |
std::set<aura::Window*> observed_windows_; |
- scoped_ptr<WindowOverview> window_overview_; |
- |
// Weak pointer to the selector delegate which will be called when a |
// selection is made. |
WindowSelectorDelegate* delegate_; |
@@ -90,6 +132,16 @@ class ASH_EXPORT WindowSelector |
// used to prevent handling the resulting expected activation. |
bool ignore_activations_; |
+ // The cursor client used to lock the current cursor during overview. |
+ aura::client::CursorClient* cursor_client_; |
+ |
+ // The time when overview was started. |
+ base::Time overview_start_time_; |
+ |
+ // Tracks windows which were hidden because they were not part of the |
+ // overview. |
+ aura::WindowTracker hidden_windows_; |
+ |
DISALLOW_COPY_AND_ASSIGN(WindowSelector); |
}; |