| 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 UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/aura/env_observer.h" | 12 #include "ui/aura/mus/focus_synchronizer_observer.h" |
| 13 #include "ui/aura/mus/window_tree_host_mus.h" | 13 #include "ui/aura/mus/window_tree_host_mus.h" |
| 14 #include "ui/aura/window_observer.h" | 14 #include "ui/aura/window_observer.h" |
| 15 #include "ui/views/mus/mus_client_observer.h" | 15 #include "ui/views/mus/mus_client_observer.h" |
| 16 #include "ui/views/mus/mus_export.h" | 16 #include "ui/views/mus/mus_export.h" |
| 17 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" | 17 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" |
| 18 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
| 19 #include "ui/views/widget/widget_observer.h" | 19 #include "ui/views/widget/widget_observer.h" |
| 20 | 20 |
| 21 namespace wm { | 21 namespace wm { |
| 22 class CursorManager; | 22 class CursorManager; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace views { | 25 namespace views { |
| 26 | 26 |
| 27 class VIEWS_MUS_EXPORT DesktopWindowTreeHostMus | 27 class VIEWS_MUS_EXPORT DesktopWindowTreeHostMus |
| 28 : public DesktopWindowTreeHost, | 28 : public DesktopWindowTreeHost, |
| 29 public MusClientObserver, | 29 public MusClientObserver, |
| 30 public WidgetObserver, | 30 public WidgetObserver, |
| 31 public aura::FocusSynchronizerObserver, |
| 31 public aura::WindowObserver, | 32 public aura::WindowObserver, |
| 32 public aura::WindowTreeHostMus, | 33 public aura::WindowTreeHostMus { |
| 33 public aura::EnvObserver { | |
| 34 public: | 34 public: |
| 35 DesktopWindowTreeHostMus( | 35 DesktopWindowTreeHostMus( |
| 36 internal::NativeWidgetDelegate* native_widget_delegate, | 36 internal::NativeWidgetDelegate* native_widget_delegate, |
| 37 DesktopNativeWidgetAura* desktop_native_widget_aura, | 37 DesktopNativeWidgetAura* desktop_native_widget_aura, |
| 38 const std::map<std::string, std::vector<uint8_t>>* mus_properties); | 38 const std::map<std::string, std::vector<uint8_t>>* mus_properties); |
| 39 ~DesktopWindowTreeHostMus() override; | 39 ~DesktopWindowTreeHostMus() override; |
| 40 | 40 |
| 41 // Called when the window was deleted on the server. | 41 // Called when the window was deleted on the server. |
| 42 void ServerDestroyedWindow() { CloseNow(); } | 42 void ServerDestroyedWindow() { CloseNow(); } |
| 43 | 43 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 bool ShouldUpdateWindowTransparency() const override; | 125 bool ShouldUpdateWindowTransparency() const override; |
| 126 bool ShouldUseDesktopNativeCursorManager() const override; | 126 bool ShouldUseDesktopNativeCursorManager() const override; |
| 127 bool ShouldCreateVisibilityController() const override; | 127 bool ShouldCreateVisibilityController() const override; |
| 128 | 128 |
| 129 // MusClientObserver: | 129 // MusClientObserver: |
| 130 void OnWindowManagerFrameValuesChanged() override; | 130 void OnWindowManagerFrameValuesChanged() override; |
| 131 | 131 |
| 132 // WidgetObserver: | 132 // WidgetObserver: |
| 133 void OnWidgetActivationChanged(Widget* widget, bool active) override; | 133 void OnWidgetActivationChanged(Widget* widget, bool active) override; |
| 134 | 134 |
| 135 // aura::FocusSynchronizerObserver: |
| 136 void OnActiveFocusClientChanged(aura::client::FocusClient* focus_client, |
| 137 aura::Window* window) override; |
| 138 |
| 135 // aura::WindowObserver: | 139 // aura::WindowObserver: |
| 136 void OnWindowPropertyChanged(aura::Window* window, | 140 void OnWindowPropertyChanged(aura::Window* window, |
| 137 const void* key, | 141 const void* key, |
| 138 intptr_t old) override; | 142 intptr_t old) override; |
| 139 | 143 |
| 140 // aura::WindowTreeHostMus: | 144 // aura::WindowTreeHostMus: |
| 141 void ShowImpl() override; | 145 void ShowImpl() override; |
| 142 void HideImpl() override; | 146 void HideImpl() override; |
| 143 void SetBoundsInPixels(const gfx::Rect& bounds_in_pixels) override; | 147 void SetBoundsInPixels(const gfx::Rect& bounds_in_pixels) override; |
| 144 | 148 |
| 145 // aura::EnvObserver: | |
| 146 void OnWindowInitialized(aura::Window* window) override; | |
| 147 void OnActiveFocusClientChanged(aura::client::FocusClient* focus_client, | |
| 148 aura::Window* window) override; | |
| 149 | |
| 150 internal::NativeWidgetDelegate* native_widget_delegate_; | 149 internal::NativeWidgetDelegate* native_widget_delegate_; |
| 151 | 150 |
| 152 DesktopNativeWidgetAura* desktop_native_widget_aura_; | 151 DesktopNativeWidgetAura* desktop_native_widget_aura_; |
| 153 | 152 |
| 154 // We can optionally have a parent which can order us to close, or own | 153 // We can optionally have a parent which can order us to close, or own |
| 155 // children who we're responsible for closing when we CloseNow(). | 154 // children who we're responsible for closing when we CloseNow(). |
| 156 DesktopWindowTreeHostMus* parent_ = nullptr; | 155 DesktopWindowTreeHostMus* parent_ = nullptr; |
| 157 std::set<DesktopWindowTreeHostMus*> children_; | 156 std::set<DesktopWindowTreeHostMus*> children_; |
| 158 | 157 |
| 159 bool is_active_ = false; | 158 bool is_active_ = false; |
| 160 | 159 |
| 161 std::unique_ptr<wm::CursorManager> cursor_manager_; | 160 std::unique_ptr<wm::CursorManager> cursor_manager_; |
| 162 | 161 |
| 163 bool auto_update_client_area_ = true; | 162 bool auto_update_client_area_ = true; |
| 164 | 163 |
| 165 // Used so that Close() isn't immediate. | 164 // Used so that Close() isn't immediate. |
| 166 base::WeakPtrFactory<DesktopWindowTreeHostMus> close_widget_factory_; | 165 base::WeakPtrFactory<DesktopWindowTreeHostMus> close_widget_factory_; |
| 167 | 166 |
| 168 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostMus); | 167 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostMus); |
| 169 }; | 168 }; |
| 170 | 169 |
| 171 } // namespace views | 170 } // namespace views |
| 172 | 171 |
| 173 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ | 172 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ |
| OLD | NEW |