| 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_WM_COMMON_WM_GLOBALS_H_ | 5 #ifndef ASH_WM_COMMON_WM_GLOBALS_H_ |
| 6 #define ASH_WM_COMMON_WM_GLOBALS_H_ | 6 #define ASH_WM_COMMON_WM_GLOBALS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Rect; | 15 class Rect; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 namespace wm { | 19 namespace wm { |
| 20 | 20 |
| 21 class WmActivationObserver; |
| 21 class WmWindow; | 22 class WmWindow; |
| 22 | 23 |
| 23 // Used for accessing global state. | 24 // Used for accessing global state. |
| 24 class ASH_EXPORT WmGlobals { | 25 class ASH_EXPORT WmGlobals { |
| 25 public: | 26 public: |
| 26 virtual ~WmGlobals() {} | 27 virtual ~WmGlobals() {} |
| 27 | 28 |
| 28 // This is necessary for a handful of places that is difficult to plumb | 29 // This is necessary for a handful of places that is difficult to plumb |
| 29 // through context. | 30 // through context. |
| 30 static WmGlobals* Get(); | 31 static WmGlobals* Get(); |
| 31 | 32 |
| 33 virtual WmWindow* GetFocusedWindow() = 0; |
| 32 virtual WmWindow* GetActiveWindow() = 0; | 34 virtual WmWindow* GetActiveWindow() = 0; |
| 33 | 35 |
| 34 // Returns the root window for the specified display. | 36 // Returns the root window for the specified display. |
| 35 virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0; | 37 virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0; |
| 36 | 38 |
| 37 // Returns the root window that newly created windows should be added to. | 39 // Returns the root window that newly created windows should be added to. |
| 38 // NOTE: this returns the root, newly created window should be added to the | 40 // NOTE: this returns the root, newly created window should be added to the |
| 39 // appropriate container in the returned window. | 41 // appropriate container in the returned window. |
| 40 virtual WmWindow* GetRootWindowForNewWindows() = 0; | 42 virtual WmWindow* GetRootWindowForNewWindows() = 0; |
| 41 | 43 |
| 42 // returns the list of more recently used windows excluding modals. | 44 // returns the list of more recently used windows excluding modals. |
| 43 virtual std::vector<WmWindow*> GetMruWindowListIgnoreModals() = 0; | 45 virtual std::vector<WmWindow*> GetMruWindowListIgnoreModals() = 0; |
| 44 | 46 |
| 45 // Returns true if the first window shown on first run should be | 47 // Returns true if the first window shown on first run should be |
| 46 // unconditionally maximized, overriding the heuristic that normally chooses | 48 // unconditionally maximized, overriding the heuristic that normally chooses |
| 47 // the window size. | 49 // the window size. |
| 48 virtual bool IsForceMaximizeOnFirstRun() = 0; | 50 virtual bool IsForceMaximizeOnFirstRun() = 0; |
| 49 | 51 |
| 50 // See aura::client::CursorClient for details on these. | 52 // See aura::client::CursorClient for details on these. |
| 51 virtual void LockCursor() = 0; | 53 virtual void LockCursor() = 0; |
| 52 virtual void UnlockCursor() = 0; | 54 virtual void UnlockCursor() = 0; |
| 53 | 55 |
| 54 virtual std::vector<WmWindow*> GetAllRootWindows() = 0; | 56 virtual std::vector<WmWindow*> GetAllRootWindows() = 0; |
| 57 |
| 58 virtual void AddActivationObserver(WmActivationObserver* observer) = 0; |
| 59 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0; |
| 55 }; | 60 }; |
| 56 | 61 |
| 57 } // namespace wm | 62 } // namespace wm |
| 58 } // namespace ash | 63 } // namespace ash |
| 59 | 64 |
| 60 #endif // ASH_WM_COMMON_WM_GLOBALS_H_ | 65 #endif // ASH_WM_COMMON_WM_GLOBALS_H_ |
| OLD | NEW |