| 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 "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 base::MakeUnique<NativeCursorManagerMus>(window())); | 271 base::MakeUnique<NativeCursorManagerMus>(window())); |
| 272 aura::client::SetCursorClient(window(), cursor_manager_.get()); | 272 aura::client::SetCursorClient(window(), cursor_manager_.get()); |
| 273 InitHost(); | 273 InitHost(); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void DesktopWindowTreeHostMus::OnNativeWidgetCreated( | 276 void DesktopWindowTreeHostMus::OnNativeWidgetCreated( |
| 277 const Widget::InitParams& params) { | 277 const Widget::InitParams& params) { |
| 278 if (params.parent && params.parent->GetHost()) { | 278 if (params.parent && params.parent->GetHost()) { |
| 279 parent_ = static_cast<DesktopWindowTreeHostMus*>(params.parent->GetHost()); | 279 parent_ = static_cast<DesktopWindowTreeHostMus*>(params.parent->GetHost()); |
| 280 parent_->children_.insert(this); | 280 parent_->children_.insert(this); |
| 281 wm::AddTransientChild(params.parent, window()); |
| 281 } | 282 } |
| 282 native_widget_delegate_->OnNativeWidgetCreated(true); | 283 native_widget_delegate_->OnNativeWidgetCreated(true); |
| 283 } | 284 } |
| 284 | 285 |
| 285 void DesktopWindowTreeHostMus::OnNativeWidgetActivationChanged(bool active) { | 286 void DesktopWindowTreeHostMus::OnNativeWidgetActivationChanged(bool active) { |
| 286 // In Mus, when our aura Window receives an activation signal, it can be | 287 // In Mus, when our aura Window receives an activation signal, it can be |
| 287 // because of remote messages. We need to forward that to Widget so that | 288 // because of remote messages. We need to forward that to Widget so that |
| 288 // Widget can notify everyone listening for that signal. | 289 // Widget can notify everyone listening for that signal. |
| 289 native_widget_delegate_->OnNativeWidgetActivationChanged(active); | 290 native_widget_delegate_->OnNativeWidgetActivationChanged(active); |
| 290 } | 291 } |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 aura::client::FocusClient* focus_client, | 729 aura::client::FocusClient* focus_client, |
| 729 aura::Window* window) { | 730 aura::Window* window) { |
| 730 if (window == this->window()) { | 731 if (window == this->window()) { |
| 731 desktop_native_widget_aura_->HandleActivationChanged(true); | 732 desktop_native_widget_aura_->HandleActivationChanged(true); |
| 732 } else if (is_active_) { | 733 } else if (is_active_) { |
| 733 desktop_native_widget_aura_->HandleActivationChanged(false); | 734 desktop_native_widget_aura_->HandleActivationChanged(false); |
| 734 } | 735 } |
| 735 } | 736 } |
| 736 | 737 |
| 737 } // namespace views | 738 } // namespace views |
| OLD | NEW |