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 #include "ui/views/mus/desktop_window_tree_host_mus.h" | 5 #include "ui/views/mus/desktop_window_tree_host_mus.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
9 #include "ui/aura/client/cursor_client.h" | 9 #include "ui/aura/client/cursor_client.h" |
10 #include "ui/aura/client/drag_drop_client.h" | 10 #include "ui/aura/client/drag_drop_client.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 DesktopNativeWidgetAura* desktop_native_widget_aura, | 173 DesktopNativeWidgetAura* desktop_native_widget_aura, |
174 const std::map<std::string, std::vector<uint8_t>>* mus_properties) | 174 const std::map<std::string, std::vector<uint8_t>>* mus_properties) |
175 : aura::WindowTreeHostMus(MusClient::Get()->window_tree_client(), | 175 : aura::WindowTreeHostMus(MusClient::Get()->window_tree_client(), |
176 mus_properties), | 176 mus_properties), |
177 native_widget_delegate_(native_widget_delegate), | 177 native_widget_delegate_(native_widget_delegate), |
178 desktop_native_widget_aura_(desktop_native_widget_aura), | 178 desktop_native_widget_aura_(desktop_native_widget_aura), |
179 fullscreen_restore_state_(ui::SHOW_STATE_DEFAULT), | 179 fullscreen_restore_state_(ui::SHOW_STATE_DEFAULT), |
180 close_widget_factory_(this) { | 180 close_widget_factory_(this) { |
181 aura::Env::GetInstance()->AddObserver(this); | 181 aura::Env::GetInstance()->AddObserver(this); |
182 MusClient::Get()->AddObserver(this); | 182 MusClient::Get()->AddObserver(this); |
183 // DesktopNativeWidgetAura registers the association between |content_window_| | |
184 // and Widget, but code may also want to go from the root (window()) to the | |
185 // Widget. This call enables that. | |
186 NativeWidgetAura::RegisterNativeWidgetForWindow(desktop_native_widget_aura, | |
187 window()); | |
188 // TODO: use display id and bounds if available, likely need to pass in | 183 // TODO: use display id and bounds if available, likely need to pass in |
189 // InitParams for that. | 184 // InitParams for that. |
190 } | 185 } |
191 | 186 |
192 DesktopWindowTreeHostMus::~DesktopWindowTreeHostMus() { | 187 DesktopWindowTreeHostMus::~DesktopWindowTreeHostMus() { |
193 MusClient::Get()->RemoveObserver(this); | 188 MusClient::Get()->RemoveObserver(this); |
194 aura::Env::GetInstance()->RemoveObserver(this); | 189 aura::Env::GetInstance()->RemoveObserver(this); |
195 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(this); | 190 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(this); |
196 } | 191 } |
197 | 192 |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 if (window == this->window()) { | 703 if (window == this->window()) { |
709 is_active_ = true; | 704 is_active_ = true; |
710 desktop_native_widget_aura_->HandleActivationChanged(true); | 705 desktop_native_widget_aura_->HandleActivationChanged(true); |
711 } else if (is_active_) { | 706 } else if (is_active_) { |
712 is_active_ = false; | 707 is_active_ = false; |
713 desktop_native_widget_aura_->HandleActivationChanged(false); | 708 desktop_native_widget_aura_->HandleActivationChanged(false); |
714 } | 709 } |
715 } | 710 } |
716 | 711 |
717 } // namespace views | 712 } // namespace views |
OLD | NEW |