Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: ui/views/mus/desktop_window_tree_host_mus.cc

Issue 2649103009: chromeos: wires transients using the WindowTreeHost window (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/mus/desktop_window_tree_host_mus_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // renders to. 265 // renders to.
266 content_window->layer()->SetFillsBoundsOpaquely(false); 266 content_window->layer()->SetFillsBoundsOpaquely(false);
267 if (!params.bounds.IsEmpty()) 267 if (!params.bounds.IsEmpty())
268 SetBoundsInDIP(params.bounds); 268 SetBoundsInDIP(params.bounds);
269 269
270 cursor_manager_ = base::MakeUnique<wm::CursorManager>( 270 cursor_manager_ = base::MakeUnique<wm::CursorManager>(
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 if (params.parent) { 275 // Transient parents are connected using the Window created by WindowTreeHost,
276 aura::client::GetTransientWindowClient()->AddTransientChild(params.parent, 276 // which is owned by the window manager. This way the window manager can
277 window()); 277 // properly identify and honor transients.
278 if (params.parent && params.parent->GetHost()) {
279 aura::client::GetTransientWindowClient()->AddTransientChild(
280 params.parent->GetHost()->window(), window());
278 } 281 }
279 } 282 }
280 283
281 void DesktopWindowTreeHostMus::OnNativeWidgetCreated( 284 void DesktopWindowTreeHostMus::OnNativeWidgetCreated(
282 const Widget::InitParams& params) { 285 const Widget::InitParams& params) {
283 if (params.parent && params.parent->GetHost()) { 286 if (params.parent && params.parent->GetHost()) {
284 parent_ = static_cast<DesktopWindowTreeHostMus*>(params.parent->GetHost()); 287 parent_ = static_cast<DesktopWindowTreeHostMus*>(params.parent->GetHost());
285 parent_->children_.insert(this); 288 parent_->children_.insert(this);
286 } 289 }
287 native_widget_delegate_->OnNativeWidgetCreated(true); 290 native_widget_delegate_->OnNativeWidgetCreated(true);
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 aura::client::FocusClient* focus_client, 729 aura::client::FocusClient* focus_client,
727 aura::Window* window) { 730 aura::Window* window) {
728 if (window == this->window()) { 731 if (window == this->window()) {
729 desktop_native_widget_aura_->HandleActivationChanged(true); 732 desktop_native_widget_aura_->HandleActivationChanged(true);
730 } else if (is_active_) { 733 } else if (is_active_) {
731 desktop_native_widget_aura_->HandleActivationChanged(false); 734 desktop_native_widget_aura_->HandleActivationChanged(false);
732 } 735 }
733 } 736 }
734 737
735 } // namespace views 738 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/mus/desktop_window_tree_host_mus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698