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..25dc9862e5ed6102ed4359db31f723334bb9c41b 100644 |
| --- a/ash/wm/overview/window_selector.h |
| +++ b/ash/wm/overview/window_selector.h |
| @@ -14,14 +14,29 @@ |
| #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" |
| #include "ui/wm/public/activation_change_observer.h" |
| namespace aura { |
| class RootWindow; |
| +class Window; |
| +namespace client { |
| +class CursorClient; |
| +} |
| +} |
| + |
| +namespace ui { |
| +class LocatedEvent; |
| +} |
| + |
| +namespace views { |
| +class Widget; |
| } |
| namespace ash { |
| -class WindowOverview; |
| class WindowSelectorDelegate; |
| class WindowSelectorItem; |
| class WindowSelectorTest; |
| @@ -29,10 +44,13 @@ class WindowSelectorTest; |
| // The WindowSelector allows selecting a window by clicking or tapping on it |
| // (entering Overview Mode). |
|
tdanderson
2014/05/13 23:25:32
Update this class-level documentation.
Nina
2014/05/14 13:52:54
I'm not sure what you mean… what should I update?
|
| class ASH_EXPORT WindowSelector |
|
tdanderson
2014/05/13 23:25:32
Just to make sure I didn't miss anything: you're n
Nina
2014/05/14 13:52:54
Exactly
|
| - : 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,16 @@ 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 +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,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); |
| }; |