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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 2924873007: Don't activate aura::Window on creation from DesktopNativeWidgetAura if NativeWidgetDelegate prohib… (Closed)
Patch Set: Comment Created 3 years, 6 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/widget/desktop_aura/desktop_native_widget_aura_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 (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
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())-> 503 wm::SetActivationDelegate(content_window_, this);
504 FocusWindow(content_window_); 504 aura::client::GetFocusClient(content_window_)->FocusWindow(content_window_);
505 505
506 OnHostResized(host()); 506 OnHostResized(host());
507 507
508 host_->AddObserver(this); 508 host_->AddObserver(this);
509 509
510 window_parenting_client_.reset( 510 window_parenting_client_.reset(
511 new DesktopNativeWidgetAuraWindowParentingClient(host_->window())); 511 new DesktopNativeWidgetAuraWindowParentingClient(host_->window()));
512 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView())); 512 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView()));
513 aura::client::SetDragDropDelegate(content_window_, this); 513 aura::client::SetDragDropDelegate(content_window_, this);
514 514
(...skipping 15 matching lines...) Expand all
530 } 530 }
531 531
532 if (params.type == Widget::InitParams::TYPE_WINDOW) { 532 if (params.type == Widget::InitParams::TYPE_WINDOW) {
533 focus_manager_event_handler_ = base::MakeUnique<FocusManagerEventHandler>( 533 focus_manager_event_handler_ = base::MakeUnique<FocusManagerEventHandler>(
534 GetWidget(), host_->window()); 534 GetWidget(), host_->window());
535 } 535 }
536 536
537 event_client_.reset(new DesktopEventClient); 537 event_client_.reset(new DesktopEventClient);
538 aura::client::SetEventClient(host_->window(), event_client_.get()); 538 aura::client::SetEventClient(host_->window(), event_client_.get());
539 539
540 aura::client::GetFocusClient(content_window_)->FocusWindow(content_window_);
541
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
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
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698