| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_COMMON_WM_WM_GLOBALS_H_ | 5 #ifndef ASH_COMMON_WM_SHELL_H_ |
| 6 #define ASH_COMMON_WM_WM_GLOBALS_H_ | 6 #define ASH_COMMON_WM_SHELL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "ash/ash_export.h" | 13 #include "ash/ash_export.h" |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Rect; | 16 class Rect; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace ash { | 19 namespace ash { |
| 20 | 20 |
| 21 class WindowResizer; | 21 class WindowResizer; |
| 22 | |
| 23 namespace wm { | |
| 24 | |
| 25 class WindowState; | |
| 26 class WmActivationObserver; | 22 class WmActivationObserver; |
| 27 class WmDisplayObserver; | 23 class WmDisplayObserver; |
| 28 class WmOverviewModeObserver; | 24 class WmOverviewModeObserver; |
| 29 class WmWindow; | 25 class WmWindow; |
| 30 | 26 |
| 27 namespace wm { |
| 28 |
| 29 class WindowState; |
| 30 |
| 31 enum class WmUserMetricsAction; | 31 enum class WmUserMetricsAction; |
| 32 } |
| 32 | 33 |
| 33 // Used for accessing global state. | 34 // Similar to ash::Shell. Eventually the two will be merged. |
| 34 class ASH_EXPORT WmGlobals { | 35 class ASH_EXPORT WmShell { |
| 35 public: | 36 public: |
| 36 virtual ~WmGlobals() {} | 37 virtual ~WmShell() {} |
| 37 | 38 |
| 38 // This is necessary for a handful of places that is difficult to plumb | 39 // This is necessary for a handful of places that is difficult to plumb |
| 39 // through context. | 40 // through context. |
| 40 static void Set(WmGlobals* instance); | 41 static void Set(WmShell* instance); |
| 41 static WmGlobals* Get(); | 42 static WmShell* Get(); |
| 42 | 43 |
| 43 // Creates a new window used as a container of other windows. No painting is | 44 // Creates a new window used as a container of other windows. No painting is |
| 44 // done to the created window. | 45 // done to the created window. |
| 45 virtual WmWindow* NewContainerWindow() = 0; | 46 virtual WmWindow* NewContainerWindow() = 0; |
| 46 | 47 |
| 47 virtual WmWindow* GetFocusedWindow() = 0; | 48 virtual WmWindow* GetFocusedWindow() = 0; |
| 48 virtual WmWindow* GetActiveWindow() = 0; | 49 virtual WmWindow* GetActiveWindow() = 0; |
| 49 | 50 |
| 50 virtual WmWindow* GetPrimaryRootWindow() = 0; | 51 virtual WmWindow* GetPrimaryRootWindow() = 0; |
| 51 | 52 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 70 | 71 |
| 71 virtual bool IsUserSessionBlocked() = 0; | 72 virtual bool IsUserSessionBlocked() = 0; |
| 72 virtual bool IsScreenLocked() = 0; | 73 virtual bool IsScreenLocked() = 0; |
| 73 | 74 |
| 74 // See aura::client::CursorClient for details on these. | 75 // See aura::client::CursorClient for details on these. |
| 75 virtual void LockCursor() = 0; | 76 virtual void LockCursor() = 0; |
| 76 virtual void UnlockCursor() = 0; | 77 virtual void UnlockCursor() = 0; |
| 77 | 78 |
| 78 virtual std::vector<WmWindow*> GetAllRootWindows() = 0; | 79 virtual std::vector<WmWindow*> GetAllRootWindows() = 0; |
| 79 | 80 |
| 80 virtual void RecordUserMetricsAction(WmUserMetricsAction action) = 0; | 81 virtual void RecordUserMetricsAction(wm::WmUserMetricsAction action) = 0; |
| 81 | 82 |
| 82 // Returns a WindowResizer to handle dragging. |next_window_resizer| is | 83 // Returns a WindowResizer to handle dragging. |next_window_resizer| is |
| 83 // the next WindowResizer in the WindowResizer chain. This may return | 84 // the next WindowResizer in the WindowResizer chain. This may return |
| 84 // |next_window_resizer|. | 85 // |next_window_resizer|. |
| 85 virtual std::unique_ptr<WindowResizer> CreateDragWindowResizer( | 86 virtual std::unique_ptr<WindowResizer> CreateDragWindowResizer( |
| 86 std::unique_ptr<WindowResizer> next_window_resizer, | 87 std::unique_ptr<WindowResizer> next_window_resizer, |
| 87 wm::WindowState* window_state) = 0; | 88 wm::WindowState* window_state) = 0; |
| 88 | 89 |
| 89 // TODO(sky): if WindowSelectorController can't be moved over, move these | 90 // TODO(sky): if WindowSelectorController can't be moved over, move these |
| 90 // onto their own local class. | 91 // onto their own local class. |
| 91 virtual bool IsOverviewModeSelecting() = 0; | 92 virtual bool IsOverviewModeSelecting() = 0; |
| 92 virtual bool IsOverviewModeRestoringMinimizedWindows() = 0; | 93 virtual bool IsOverviewModeRestoringMinimizedWindows() = 0; |
| 93 | 94 |
| 94 virtual void AddActivationObserver(WmActivationObserver* observer) = 0; | 95 virtual void AddActivationObserver(WmActivationObserver* observer) = 0; |
| 95 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0; | 96 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0; |
| 96 | 97 |
| 97 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; | 98 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; |
| 98 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; | 99 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; |
| 99 | 100 |
| 100 virtual void AddOverviewModeObserver(WmOverviewModeObserver* observer) = 0; | 101 virtual void AddOverviewModeObserver(WmOverviewModeObserver* observer) = 0; |
| 101 virtual void RemoveOverviewModeObserver(WmOverviewModeObserver* observer) = 0; | 102 virtual void RemoveOverviewModeObserver(WmOverviewModeObserver* observer) = 0; |
| 102 | 103 |
| 103 private: | 104 private: |
| 104 static WmGlobals* instance_; | 105 static WmShell* instance_; |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 } // namespace wm | |
| 108 } // namespace ash | 108 } // namespace ash |
| 109 | 109 |
| 110 #endif // ASH_COMMON_WM_WM_GLOBALS_H_ | 110 #endif // ASH_COMMON_WM_SHELL_H_ |
| OLD | NEW |