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/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 // which is owned by the window manager. This way the window manager can | 300 // which is owned by the window manager. This way the window manager can |
301 // properly identify and honor transients. | 301 // properly identify and honor transients. |
302 if (params.parent && params.parent->GetHost()) { | 302 if (params.parent && params.parent->GetHost()) { |
303 aura::client::GetTransientWindowClient()->AddTransientChild( | 303 aura::client::GetTransientWindowClient()->AddTransientChild( |
304 params.parent->GetHost()->window(), window()); | 304 params.parent->GetHost()->window(), window()); |
305 } | 305 } |
306 | 306 |
307 if (!params.accept_events) { | 307 if (!params.accept_events) { |
308 aura::WindowPortMus::Get(window())->SetEventTargetingPolicy( | 308 aura::WindowPortMus::Get(window())->SetEventTargetingPolicy( |
309 ui::mojom::EventTargetingPolicy::NONE); | 309 ui::mojom::EventTargetingPolicy::NONE); |
310 } else { | |
311 // Only enable drops if the window accepts events. | |
sky
2017/03/10 21:00:57
Did you mean to have a TODO here?
Elliot Glaysher
2017/03/10 21:30:07
No, this comment is descriptive that we only want
| |
312 aura::WindowPortMus::Get(content_window)->SetCanAcceptDrops(true); | |
310 } | 313 } |
311 } | 314 } |
312 | 315 |
313 void DesktopWindowTreeHostMus::OnNativeWidgetCreated( | 316 void DesktopWindowTreeHostMus::OnNativeWidgetCreated( |
314 const Widget::InitParams& params) { | 317 const Widget::InitParams& params) { |
315 window()->SetName(params.name); | 318 window()->SetName(params.name); |
316 desktop_native_widget_aura_->content_window()->SetName( | 319 desktop_native_widget_aura_->content_window()->SetName( |
317 "DesktopNativeWidgetAura - content window"); | 320 "DesktopNativeWidgetAura - content window"); |
318 if (params.parent && params.parent->GetHost()) { | 321 if (params.parent && params.parent->GetHost()) { |
319 parent_ = static_cast<DesktopWindowTreeHostMus*>(params.parent->GetHost()); | 322 parent_ = static_cast<DesktopWindowTreeHostMus*>(params.parent->GetHost()); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
813 aura::client::FocusClient* focus_client, | 816 aura::client::FocusClient* focus_client, |
814 aura::Window* window) { | 817 aura::Window* window) { |
815 if (window == this->window()) { | 818 if (window == this->window()) { |
816 desktop_native_widget_aura_->HandleActivationChanged(true); | 819 desktop_native_widget_aura_->HandleActivationChanged(true); |
817 } else if (is_active_) { | 820 } else if (is_active_) { |
818 desktop_native_widget_aura_->HandleActivationChanged(false); | 821 desktop_native_widget_aura_->HandleActivationChanged(false); |
819 } | 822 } |
820 } | 823 } |
821 | 824 |
822 } // namespace views | 825 } // namespace views |
OLD | NEW |