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/debug/trace_event.h" | 8 #include "base/debug/trace_event.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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 | 483 |
484 static_cast<aura::client::FocusClient*>(focus_client_.get())-> | 484 static_cast<aura::client::FocusClient*>(focus_client_.get())-> |
485 FocusWindow(content_window_); | 485 FocusWindow(content_window_); |
486 | 486 |
487 OnHostResized(host()); | 487 OnHostResized(host()); |
488 | 488 |
489 host_->AddObserver(this); | 489 host_->AddObserver(this); |
490 | 490 |
491 window_tree_client_.reset( | 491 window_tree_client_.reset( |
492 new DesktopNativeWidgetAuraWindowTreeClient(host_->window())); | 492 new DesktopNativeWidgetAuraWindowTreeClient(host_->window())); |
493 drop_helper_.reset(new DropHelper( | 493 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView())); |
494 static_cast<internal::RootView*>(GetWidget()->GetRootView()))); | |
495 aura::client::SetDragDropDelegate(content_window_, this); | 494 aura::client::SetDragDropDelegate(content_window_, this); |
496 | 495 |
497 tooltip_manager_.reset(new TooltipManagerAura(GetWidget())); | 496 tooltip_manager_.reset(new TooltipManagerAura(GetWidget())); |
498 | 497 |
499 tooltip_controller_.reset( | 498 tooltip_controller_.reset( |
500 new corewm::TooltipController( | 499 new corewm::TooltipController( |
501 desktop_window_tree_host_->CreateTooltip())); | 500 desktop_window_tree_host_->CreateTooltip())); |
502 aura::client::SetTooltipClient(host_->window(), | 501 aura::client::SetTooltipClient(host_->window(), |
503 tooltip_controller_.get()); | 502 tooltip_controller_.get()); |
504 host_->window()->AddPreTargetHandler(tooltip_controller_.get()); | 503 host_->window()->AddPreTargetHandler(tooltip_controller_.get()); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
584 | 583 |
585 ui::Layer* DesktopNativeWidgetAura::GetLayer() { | 584 ui::Layer* DesktopNativeWidgetAura::GetLayer() { |
586 return content_window_ ? content_window_->layer() : NULL; | 585 return content_window_ ? content_window_->layer() : NULL; |
587 } | 586 } |
588 | 587 |
589 void DesktopNativeWidgetAura::ReorderNativeViews() { | 588 void DesktopNativeWidgetAura::ReorderNativeViews() { |
590 window_reorderer_->ReorderChildWindows(); | 589 window_reorderer_->ReorderChildWindows(); |
591 } | 590 } |
592 | 591 |
593 void DesktopNativeWidgetAura::ViewRemoved(View* view) { | 592 void DesktopNativeWidgetAura::ViewRemoved(View* view) { |
593 DCHECK(drop_helper_.get() != NULL); | |
594 drop_helper_->ResetTargetViewIfEquals(view); | |
varkha
2014/03/31 17:40:52
This is same as the code in NativeWidgetAura::View
| |
594 } | 595 } |
595 | 596 |
596 void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name, | 597 void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name, |
597 void* value) { | 598 void* value) { |
598 if (content_window_) | 599 if (content_window_) |
599 content_window_->SetNativeWindowProperty(name, value); | 600 content_window_->SetNativeWindowProperty(name, value); |
600 } | 601 } |
601 | 602 |
602 void* DesktopNativeWidgetAura::GetNativeWindowProperty(const char* name) const { | 603 void* DesktopNativeWidgetAura::GetNativeWindowProperty(const char* name) const { |
603 return content_window_ ? | 604 return content_window_ ? |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1190 if (cursor_reference_count_ == 0) { | 1191 if (cursor_reference_count_ == 0) { |
1191 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1192 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
1192 // for cleaning up |cursor_manager_|. | 1193 // for cleaning up |cursor_manager_|. |
1193 delete cursor_manager_; | 1194 delete cursor_manager_; |
1194 native_cursor_manager_ = NULL; | 1195 native_cursor_manager_ = NULL; |
1195 cursor_manager_ = NULL; | 1196 cursor_manager_ = NULL; |
1196 } | 1197 } |
1197 } | 1198 } |
1198 | 1199 |
1199 } // namespace views | 1200 } // namespace views |
OLD | NEW |