Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/widget/desktop_aura/desktop_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 493 host_->window()->AddPreTargetHandler(focus_controller); | 493 host_->window()->AddPreTargetHandler(focus_controller); |
| 494 | 494 |
| 495 position_client_.reset(new DesktopScreenPositionClient(host_->window())); | 495 position_client_.reset(new DesktopScreenPositionClient(host_->window())); |
| 496 | 496 |
| 497 drag_drop_client_ = desktop_window_tree_host_->CreateDragDropClient( | 497 drag_drop_client_ = desktop_window_tree_host_->CreateDragDropClient( |
| 498 native_cursor_manager_); | 498 native_cursor_manager_); |
| 499 // Mus returns null from CreateDragDropClient(). | 499 // Mus returns null from CreateDragDropClient(). |
| 500 if (drag_drop_client_) | 500 if (drag_drop_client_) |
| 501 aura::client::SetDragDropClient(host_->window(), drag_drop_client_.get()); | 501 aura::client::SetDragDropClient(host_->window(), drag_drop_client_.get()); |
| 502 | 502 |
| 503 static_cast<aura::client::FocusClient*>(focus_client_.get())-> | |
|
sky
2017/06/08 19:45:32
Shouldn't this code still focus the window for the
vasilii
2017/06/09 12:36:45
Done. Moved the call despite I don't see the place
| |
| 504 FocusWindow(content_window_); | |
| 505 | |
| 506 OnHostResized(host()); | 503 OnHostResized(host()); |
| 507 | 504 |
| 508 host_->AddObserver(this); | 505 host_->AddObserver(this); |
| 509 | 506 |
| 510 window_parenting_client_.reset( | 507 window_parenting_client_.reset( |
| 511 new DesktopNativeWidgetAuraWindowParentingClient(host_->window())); | 508 new DesktopNativeWidgetAuraWindowParentingClient(host_->window())); |
| 512 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView())); | 509 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView())); |
| 513 aura::client::SetDragDropDelegate(content_window_, this); | 510 aura::client::SetDragDropDelegate(content_window_, this); |
| 514 | 511 |
| 515 if (params.type != Widget::InitParams::TYPE_TOOLTIP) { | 512 if (params.type != Widget::InitParams::TYPE_TOOLTIP) { |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 530 } | 527 } |
| 531 | 528 |
| 532 if (params.type == Widget::InitParams::TYPE_WINDOW) { | 529 if (params.type == Widget::InitParams::TYPE_WINDOW) { |
| 533 focus_manager_event_handler_ = base::MakeUnique<FocusManagerEventHandler>( | 530 focus_manager_event_handler_ = base::MakeUnique<FocusManagerEventHandler>( |
| 534 GetWidget(), host_->window()); | 531 GetWidget(), host_->window()); |
| 535 } | 532 } |
| 536 | 533 |
| 537 event_client_.reset(new DesktopEventClient); | 534 event_client_.reset(new DesktopEventClient); |
| 538 aura::client::SetEventClient(host_->window(), event_client_.get()); | 535 aura::client::SetEventClient(host_->window(), event_client_.get()); |
| 539 | 536 |
| 537 wm::SetActivationDelegate(content_window_, this); | |
| 540 aura::client::GetFocusClient(content_window_)->FocusWindow(content_window_); | 538 aura::client::GetFocusClient(content_window_)->FocusWindow(content_window_); |
| 541 | 539 |
| 542 wm::SetActivationDelegate(content_window_, this); | |
| 543 | |
| 544 shadow_controller_.reset( | 540 shadow_controller_.reset( |
| 545 new wm::ShadowController(wm::GetActivationClient(host_->window()))); | 541 new wm::ShadowController(wm::GetActivationClient(host_->window()))); |
| 546 | 542 |
| 547 OnSizeConstraintsChanged(); | 543 OnSizeConstraintsChanged(); |
| 548 | 544 |
| 549 window_reorderer_.reset(new WindowReorderer(content_window_, | 545 window_reorderer_.reset(new WindowReorderer(content_window_, |
| 550 GetWidget()->GetRootView())); | 546 GetWidget()->GetRootView())); |
| 551 } | 547 } |
| 552 | 548 |
| 553 void DesktopNativeWidgetAura::OnWidgetInitDone() { | 549 void DesktopNativeWidgetAura::OnWidgetInitDone() { |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1212 if (cursor_reference_count_ == 0) { | 1208 if (cursor_reference_count_ == 0) { |
| 1213 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1209 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
| 1214 // for cleaning up |cursor_manager_|. | 1210 // for cleaning up |cursor_manager_|. |
| 1215 delete cursor_manager_; | 1211 delete cursor_manager_; |
| 1216 native_cursor_manager_ = NULL; | 1212 native_cursor_manager_ = NULL; |
| 1217 cursor_manager_ = NULL; | 1213 cursor_manager_ = NULL; |
| 1218 } | 1214 } |
| 1219 } | 1215 } |
| 1220 | 1216 |
| 1221 } // namespace views | 1217 } // namespace views |
| OLD | NEW |