platformKeys: Add per-extension sign permissions.
[chromium-blink-merge.git] / ash / wm / overview / window_selector_controller.h
blob3a879040165aa16fec6ca01632160d2eaa7112b9
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_
6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_
8 #include <list>
9 #include <vector>
11 #include "ash/ash_export.h"
12 #include "ash/wm/overview/window_selector.h"
13 #include "ash/wm/overview/window_selector_delegate.h"
14 #include "base/basictypes.h"
15 #include "base/memory/scoped_ptr.h"
16 #include "base/time/time.h"
17 #include "ui/aura/window_observer.h"
19 namespace aura {
20 class Window;
23 namespace ash {
24 class WindowSelector;
25 class WindowSelectorTest;
27 // Manages a window selector which displays an overview of all windows and
28 // allows selecting a window to activate it.
29 class ASH_EXPORT WindowSelectorController
30 : public WindowSelectorDelegate {
31 public:
32 WindowSelectorController();
33 ~WindowSelectorController() override;
35 // Returns true if selecting windows in an overview is enabled. This is false
36 // at certain times, such as when the lock screen is visible.
37 static bool CanSelect();
39 // Enters overview mode. This is essentially the window cycling mode however
40 // not released on releasing the alt key and allows selecting with the mouse
41 // or touch rather than keypresses.
42 void ToggleOverview();
44 // Returns true if window selection mode is active.
45 bool IsSelecting();
47 // Returns true if overview mode is restoring minimized windows so that they
48 // are visible during overview mode.
49 bool IsRestoringMinimizedWindows() const;
51 bool swipe_to_close_disabled() const { return swipe_to_close_disabled_; }
53 // WindowSelectorDelegate:
54 void OnSelectionEnded() override;
56 private:
57 friend class WindowSelectorTest;
59 // Dispatched when window selection begins.
60 void OnSelectionStarted();
62 scoped_ptr<WindowSelector> window_selector_;
63 base::Time last_selection_time_;
65 // Tracks whether the "Swipe-to-close" feature is disabled.
66 bool swipe_to_close_disabled_;
68 DISALLOW_COPY_AND_ASSIGN(WindowSelectorController);
71 } // namespace ash
73 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_