| 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 WmRootWindowControllerMus; | 29 class WmRootWindowControllerMus; |
| 30 class WmWindowMus; | 30 class WmWindowMus; |
| 31 | 31 |
| 32 // WmShell implementation for mus. | 32 // WmShell implementation for mus. |
| 33 class WmShellMus : public WmShell, public ::ui::WindowTreeClientObserver { | 33 class WmShellMus : public WmShell, public ::ui::WindowTreeClientObserver { |
| 34 public: | 34 public: |
| 35 WmShellMus(std::unique_ptr<ShellDelegate> shell_delegate, | 35 WmShellMus(std::unique_ptr<ShellDelegate> shell_delegate, |
| 36 ::ui::WindowTreeClient* client, | 36 ::ui::WindowTreeClient* client); |
| 37 shell::Connector* connector); | |
| 38 ~WmShellMus() override; | 37 ~WmShellMus() override; |
| 39 | 38 |
| 40 static WmShellMus* Get(); | 39 static WmShellMus* Get(); |
| 41 | 40 |
| 42 void AddRootWindowController(WmRootWindowControllerMus* controller); | 41 void AddRootWindowController(WmRootWindowControllerMus* controller); |
| 43 void RemoveRootWindowController(WmRootWindowControllerMus* controller); | 42 void RemoveRootWindowController(WmRootWindowControllerMus* controller); |
| 44 | 43 |
| 45 // Returns the ancestor of |window| (including |window|) that is considered | 44 // Returns the ancestor of |window| (including |window|) that is considered |
| 46 // toplevel. |window| may be null. | 45 // toplevel. |window| may be null. |
| 47 static WmWindowMus* GetToplevelAncestor(::ui::Window* window); | 46 static WmWindowMus* GetToplevelAncestor(::ui::Window* window); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 67 void RecordUserMetricsAction(UserMetricsAction action) override; | 66 void RecordUserMetricsAction(UserMetricsAction action) override; |
| 68 std::unique_ptr<WindowResizer> CreateDragWindowResizer( | 67 std::unique_ptr<WindowResizer> CreateDragWindowResizer( |
| 69 std::unique_ptr<WindowResizer> next_window_resizer, | 68 std::unique_ptr<WindowResizer> next_window_resizer, |
| 70 wm::WindowState* window_state) override; | 69 wm::WindowState* window_state) override; |
| 71 std::unique_ptr<wm::MaximizeModeEventHandler> CreateMaximizeModeEventHandler() | 70 std::unique_ptr<wm::MaximizeModeEventHandler> CreateMaximizeModeEventHandler() |
| 72 override; | 71 override; |
| 73 std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> | 72 std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> |
| 74 CreateScopedDisableInternalMouseAndKeyboard() override; | 73 CreateScopedDisableInternalMouseAndKeyboard() override; |
| 75 void OnOverviewModeStarting() override; | 74 void OnOverviewModeStarting() override; |
| 76 void OnOverviewModeEnded() override; | 75 void OnOverviewModeEnded() override; |
| 77 AccessibilityDelegate* GetAccessibilityDelegate() override; | |
| 78 SessionStateDelegate* GetSessionStateDelegate() override; | 76 SessionStateDelegate* GetSessionStateDelegate() override; |
| 79 void AddActivationObserver(WmActivationObserver* observer) override; | 77 void AddActivationObserver(WmActivationObserver* observer) override; |
| 80 void RemoveActivationObserver(WmActivationObserver* observer) override; | 78 void RemoveActivationObserver(WmActivationObserver* observer) override; |
| 81 void AddDisplayObserver(WmDisplayObserver* observer) override; | 79 void AddDisplayObserver(WmDisplayObserver* observer) override; |
| 82 void RemoveDisplayObserver(WmDisplayObserver* observer) override; | 80 void RemoveDisplayObserver(WmDisplayObserver* observer) override; |
| 83 void AddPointerWatcher(views::PointerWatcher* watcher) override; | 81 void AddPointerWatcher(views::PointerWatcher* watcher) override; |
| 84 void RemovePointerWatcher(views::PointerWatcher* watcher) override; | 82 void RemovePointerWatcher(views::PointerWatcher* watcher) override; |
| 85 #if defined(OS_CHROMEOS) | 83 #if defined(OS_CHROMEOS) |
| 86 void ToggleIgnoreExternalKeyboard() override; | 84 void ToggleIgnoreExternalKeyboard() override; |
| 87 #endif | 85 #endif |
| 88 | 86 |
| 89 private: | 87 private: |
| 90 // Returns true if |window| is a window that can have active children. | 88 // Returns true if |window| is a window that can have active children. |
| 91 static bool IsActivationParent(::ui::Window* window); | 89 static bool IsActivationParent(::ui::Window* window); |
| 92 | 90 |
| 93 void RemoveClientObserver(); | 91 void RemoveClientObserver(); |
| 94 | 92 |
| 95 // ::ui::WindowTreeClientObserver: | 93 // ::ui::WindowTreeClientObserver: |
| 96 void OnWindowTreeFocusChanged(::ui::Window* gained_focus, | 94 void OnWindowTreeFocusChanged(::ui::Window* gained_focus, |
| 97 ::ui::Window* lost_focus) override; | 95 ::ui::Window* lost_focus) override; |
| 98 void OnDidDestroyClient(::ui::WindowTreeClient* client) override; | 96 void OnDidDestroyClient(::ui::WindowTreeClient* client) override; |
| 99 | 97 |
| 100 ::ui::WindowTreeClient* client_; | 98 ::ui::WindowTreeClient* client_; |
| 101 shell::Connector* connector_; | |
| 102 | 99 |
| 103 std::vector<WmRootWindowControllerMus*> root_window_controllers_; | 100 std::vector<WmRootWindowControllerMus*> root_window_controllers_; |
| 104 | 101 |
| 105 std::unique_ptr<SessionStateDelegate> session_state_delegate_; | 102 std::unique_ptr<SessionStateDelegate> session_state_delegate_; |
| 106 | 103 |
| 107 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_; | |
| 108 | |
| 109 base::ObserverList<WmActivationObserver> activation_observers_; | 104 base::ObserverList<WmActivationObserver> activation_observers_; |
| 110 | 105 |
| 111 DISALLOW_COPY_AND_ASSIGN(WmShellMus); | 106 DISALLOW_COPY_AND_ASSIGN(WmShellMus); |
| 112 }; | 107 }; |
| 113 | 108 |
| 114 } // namespace mus | 109 } // namespace mus |
| 115 } // namespace ash | 110 } // namespace ash |
| 116 | 111 |
| 117 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ | 112 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ |
| OLD | NEW |