Chromium Code Reviews| 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..a22c3a43441cc39f9c18a928f9898f15d9ba75d3 100644 |
| --- a/ash/wm/overview/window_selector.h |
| +++ b/ash/wm/overview/window_selector.h |
| @@ -14,25 +14,43 @@ |
| #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/gfx/rect.h" |
|
flackr
2014/05/15 21:28:14
This doesn't seem to be used directly.
|
| #include "ui/wm/public/activation_change_observer.h" |
| namespace aura { |
| class RootWindow; |
| +class Window; |
| +namespace client { |
| +class CursorClient; |
| +} // namespace client |
| +} // namespace aura |
| + |
| +namespace ui { |
| +class LocatedEvent; |
| +} |
| + |
| +namespace views { |
| +class Widget; |
| } |
| 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 +62,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, |
| @@ -64,10 +93,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 +120,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 +133,23 @@ 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_; |
| + |
| + // Widget indicating which window is currently selected. |
| + scoped_ptr<views::Widget> selection_widget_; |
| + |
| + // Index of the currently selected window. This is used to determine when the |
| + // selection changes rows and use a different animation. |
| + size_t selection_index_; |
| + |
| + // 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); |
| }; |