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" | |
13 #include "ui/aura/mus/window_tree_host_mus.h" | 12 #include "ui/aura/mus/window_tree_host_mus.h" |
14 #include "ui/views/mus/mus_export.h" | 13 #include "ui/views/mus/mus_export.h" |
15 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" | 14 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" |
16 | 15 |
17 namespace views { | 16 namespace views { |
18 | 17 |
19 class VIEWS_MUS_EXPORT DesktopWindowTreeHostMus | 18 class VIEWS_MUS_EXPORT DesktopWindowTreeHostMus |
20 : public DesktopWindowTreeHost, | 19 : public DesktopWindowTreeHost, |
21 public aura::WindowTreeHostMus, | 20 public aura::WindowTreeHostMus { |
22 public aura::EnvObserver { | |
23 public: | 21 public: |
24 DesktopWindowTreeHostMus( | 22 DesktopWindowTreeHostMus( |
25 internal::NativeWidgetDelegate* native_widget_delegate, | 23 internal::NativeWidgetDelegate* native_widget_delegate, |
26 DesktopNativeWidgetAura* desktop_native_widget_aura); | 24 DesktopNativeWidgetAura* desktop_native_widget_aura); |
27 ~DesktopWindowTreeHostMus() override; | 25 ~DesktopWindowTreeHostMus() override; |
28 | 26 |
29 private: | 27 private: |
30 bool IsDocked() const; | 28 bool IsDocked() const; |
31 | 29 |
32 // DesktopWindowTreeHost: | 30 // DesktopWindowTreeHost: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 void SetOpacity(float opacity) override; | 81 void SetOpacity(float opacity) override; |
84 void SetWindowIcons(const gfx::ImageSkia& window_icon, | 82 void SetWindowIcons(const gfx::ImageSkia& window_icon, |
85 const gfx::ImageSkia& app_icon) override; | 83 const gfx::ImageSkia& app_icon) override; |
86 void InitModalType(ui::ModalType modal_type) override; | 84 void InitModalType(ui::ModalType modal_type) override; |
87 void FlashFrame(bool flash_frame) override; | 85 void FlashFrame(bool flash_frame) override; |
88 void OnRootViewLayout() override; | 86 void OnRootViewLayout() override; |
89 bool IsAnimatingClosed() const override; | 87 bool IsAnimatingClosed() const override; |
90 bool IsTranslucentWindowOpacitySupported() const override; | 88 bool IsTranslucentWindowOpacitySupported() const override; |
91 void SizeConstraintsChanged() override; | 89 void SizeConstraintsChanged() override; |
92 | 90 |
93 // aura::EnvObserver: | |
94 void OnWindowInitialized(aura::Window* window) override; | |
95 void OnActiveFocusClientChanged(aura::client::FocusClient* focus_client, | |
96 aura::Window* window) override; | |
97 | |
98 internal::NativeWidgetDelegate* native_widget_delegate_; | 91 internal::NativeWidgetDelegate* native_widget_delegate_; |
99 | 92 |
100 DesktopNativeWidgetAura* desktop_native_widget_aura_; | 93 DesktopNativeWidgetAura* desktop_native_widget_aura_; |
101 | 94 |
102 // State to restore window to when exiting fullscreen. Only valid if | 95 // State to restore window to when exiting fullscreen. Only valid if |
103 // fullscreen. | 96 // fullscreen. |
104 ui::WindowShowState fullscreen_restore_state_; | 97 ui::WindowShowState fullscreen_restore_state_; |
105 | 98 |
106 // We can optionally have a parent which can order us to close, or own | 99 // We can optionally have a parent which can order us to close, or own |
107 // children who we're responsible for closing when we CloseNow(). | 100 // children who we're responsible for closing when we CloseNow(). |
108 DesktopWindowTreeHostMus* parent_ = nullptr; | 101 DesktopWindowTreeHostMus* parent_ = nullptr; |
109 std::set<DesktopWindowTreeHostMus*> children_; | 102 std::set<DesktopWindowTreeHostMus*> children_; |
110 | 103 |
111 bool is_active_ = false; | |
112 | |
113 // Used so that Close() isn't immediate. | 104 // Used so that Close() isn't immediate. |
114 base::WeakPtrFactory<DesktopWindowTreeHostMus> close_widget_factory_; | 105 base::WeakPtrFactory<DesktopWindowTreeHostMus> close_widget_factory_; |
115 | 106 |
116 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostMus); | 107 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostMus); |
117 }; | 108 }; |
118 | 109 |
119 } // namespace views | 110 } // namespace views |
120 | 111 |
121 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ | 112 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ |
OLD | NEW |