| 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_MUS_BRIDGE_WM_SHELL_MUS_H_ | 5 #ifndef ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ |
| 6 #define ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ | 6 #define ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 namespace ash { | 26 namespace ash { |
| 27 namespace mus { | 27 namespace mus { |
| 28 | 28 |
| 29 class AcceleratorControllerDelegateMus; | 29 class AcceleratorControllerDelegateMus; |
| 30 class AcceleratorControllerRegistrar; | 30 class AcceleratorControllerRegistrar; |
| 31 class WindowManager; | 31 class WindowManager; |
| 32 class WmRootWindowControllerMus; | 32 class WmRootWindowControllerMus; |
| 33 class WmWindowMus; | 33 class WmWindowMus; |
| 34 | 34 |
| 35 // WmShell implementation for mus. | 35 // WmShell implementation for mus. |
| 36 class WmShellMus : public WmShell, public ::ui::WindowTreeClientObserver { | 36 class WmShellMus : public WmShell, public ui::WindowTreeClientObserver { |
| 37 public: | 37 public: |
| 38 WmShellMus(std::unique_ptr<ShellDelegate> shell_delegate, | 38 WmShellMus(std::unique_ptr<ShellDelegate> shell_delegate, |
| 39 WindowManager* window_manager); | 39 WindowManager* window_manager); |
| 40 ~WmShellMus() override; | 40 ~WmShellMus() override; |
| 41 | 41 |
| 42 static WmShellMus* Get(); | 42 static WmShellMus* Get(); |
| 43 | 43 |
| 44 void AddRootWindowController(WmRootWindowControllerMus* controller); | 44 void AddRootWindowController(WmRootWindowControllerMus* controller); |
| 45 void RemoveRootWindowController(WmRootWindowControllerMus* controller); | 45 void RemoveRootWindowController(WmRootWindowControllerMus* controller); |
| 46 | 46 |
| 47 // Returns the ancestor of |window| (including |window|) that is considered | 47 // Returns the ancestor of |window| (including |window|) that is considered |
| 48 // toplevel. |window| may be null. | 48 // toplevel. |window| may be null. |
| 49 static WmWindowMus* GetToplevelAncestor(::ui::Window* window); | 49 static WmWindowMus* GetToplevelAncestor(ui::Window* window); |
| 50 | 50 |
| 51 WmRootWindowControllerMus* GetRootWindowControllerWithDisplayId(int64_t id); | 51 WmRootWindowControllerMus* GetRootWindowControllerWithDisplayId(int64_t id); |
| 52 | 52 |
| 53 AcceleratorControllerDelegateMus* accelerator_controller_delegate() { | 53 AcceleratorControllerDelegateMus* accelerator_controller_delegate() { |
| 54 return accelerator_controller_delegate_.get(); | 54 return accelerator_controller_delegate_.get(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // WmShell: | 57 // WmShell: |
| 58 WmWindow* NewContainerWindow() override; | 58 WmWindow* NewContainerWindow() override; |
| 59 WmWindow* GetFocusedWindow() override; | 59 WmWindow* GetFocusedWindow() override; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 88 void RemoveActivationObserver(WmActivationObserver* observer) override; | 88 void RemoveActivationObserver(WmActivationObserver* observer) override; |
| 89 void AddDisplayObserver(WmDisplayObserver* observer) override; | 89 void AddDisplayObserver(WmDisplayObserver* observer) override; |
| 90 void RemoveDisplayObserver(WmDisplayObserver* observer) override; | 90 void RemoveDisplayObserver(WmDisplayObserver* observer) override; |
| 91 void AddPointerWatcher(views::PointerWatcher* watcher) override; | 91 void AddPointerWatcher(views::PointerWatcher* watcher) override; |
| 92 void RemovePointerWatcher(views::PointerWatcher* watcher) override; | 92 void RemovePointerWatcher(views::PointerWatcher* watcher) override; |
| 93 #if defined(OS_CHROMEOS) | 93 #if defined(OS_CHROMEOS) |
| 94 void ToggleIgnoreExternalKeyboard() override; | 94 void ToggleIgnoreExternalKeyboard() override; |
| 95 #endif | 95 #endif |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 ::ui::WindowTreeClient* window_tree_client(); | 98 ui::WindowTreeClient* window_tree_client(); |
| 99 | 99 |
| 100 // Returns true if |window| is a window that can have active children. | 100 // Returns true if |window| is a window that can have active children. |
| 101 static bool IsActivationParent(::ui::Window* window); | 101 static bool IsActivationParent(ui::Window* window); |
| 102 | 102 |
| 103 // ::ui::WindowTreeClientObserver: | 103 // ui::WindowTreeClientObserver: |
| 104 void OnWindowTreeFocusChanged(::ui::Window* gained_focus, | 104 void OnWindowTreeFocusChanged(ui::Window* gained_focus, |
| 105 ::ui::Window* lost_focus) override; | 105 ui::Window* lost_focus) override; |
| 106 void OnDidDestroyClient(::ui::WindowTreeClient* client) override; | 106 void OnDidDestroyClient(ui::WindowTreeClient* client) override; |
| 107 | 107 |
| 108 WindowManager* window_manager_; | 108 WindowManager* window_manager_; |
| 109 | 109 |
| 110 std::vector<WmRootWindowControllerMus*> root_window_controllers_; | 110 std::vector<WmRootWindowControllerMus*> root_window_controllers_; |
| 111 | 111 |
| 112 std::unique_ptr<AcceleratorControllerDelegateMus> | 112 std::unique_ptr<AcceleratorControllerDelegateMus> |
| 113 accelerator_controller_delegate_; | 113 accelerator_controller_delegate_; |
| 114 std::unique_ptr<AcceleratorControllerRegistrar> | 114 std::unique_ptr<AcceleratorControllerRegistrar> |
| 115 accelerator_controller_registrar_; | 115 accelerator_controller_registrar_; |
| 116 std::unique_ptr<SessionStateDelegate> session_state_delegate_; | 116 std::unique_ptr<SessionStateDelegate> session_state_delegate_; |
| 117 | 117 |
| 118 base::ObserverList<WmActivationObserver> activation_observers_; | 118 base::ObserverList<WmActivationObserver> activation_observers_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(WmShellMus); | 120 DISALLOW_COPY_AND_ASSIGN(WmShellMus); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace mus | 123 } // namespace mus |
| 124 } // namespace ash | 124 } // namespace ash |
| 125 | 125 |
| 126 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ | 126 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ |
| OLD | NEW |