| 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 // deactivated (child widgets don't get native desktop activation changes, | 383 // deactivated (child widgets don't get native desktop activation changes, |
| 384 // only aura activation changes). | 384 // only aura activation changes). |
| 385 aura::Window* active_window = activation_client->GetActiveWindow(); | 385 aura::Window* active_window = activation_client->GetActiveWindow(); |
| 386 if (active_window) { | 386 if (active_window) { |
| 387 activation_client->DeactivateWindow(active_window); | 387 activation_client->DeactivateWindow(active_window); |
| 388 GetInputMethod()->OnBlur(); | 388 GetInputMethod()->OnBlur(); |
| 389 } | 389 } |
| 390 } | 390 } |
| 391 } | 391 } |
| 392 | 392 |
| 393 void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name, |
| 394 void* value) { |
| 395 if (content_window_) |
| 396 content_window_->SetNativeWindowProperty(name, value); |
| 397 } |
| 398 |
| 393 //////////////////////////////////////////////////////////////////////////////// | 399 //////////////////////////////////////////////////////////////////////////////// |
| 394 // DesktopNativeWidgetAura, internal::NativeWidgetPrivate implementation: | 400 // DesktopNativeWidgetAura, internal::NativeWidgetPrivate implementation: |
| 395 | 401 |
| 396 void DesktopNativeWidgetAura::InitNativeWidget( | 402 void DesktopNativeWidgetAura::InitNativeWidget( |
| 397 const Widget::InitParams& params) { | 403 const Widget::InitParams& params) { |
| 398 ownership_ = params.ownership; | 404 ownership_ = params.ownership; |
| 399 widget_type_ = params.type; | 405 widget_type_ = params.type; |
| 400 name_ = params.name; | 406 name_ = params.name; |
| 401 | 407 |
| 402 NativeWidgetAura::RegisterNativeWidgetForWindow(this, content_window_); | 408 NativeWidgetAura::RegisterNativeWidgetForWindow(this, content_window_); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 | 594 |
| 589 void DesktopNativeWidgetAura::ReorderNativeViews() { | 595 void DesktopNativeWidgetAura::ReorderNativeViews() { |
| 590 window_reorderer_->ReorderChildWindows(); | 596 window_reorderer_->ReorderChildWindows(); |
| 591 } | 597 } |
| 592 | 598 |
| 593 void DesktopNativeWidgetAura::ViewRemoved(View* view) { | 599 void DesktopNativeWidgetAura::ViewRemoved(View* view) { |
| 594 DCHECK(drop_helper_.get() != NULL); | 600 DCHECK(drop_helper_.get() != NULL); |
| 595 drop_helper_->ResetTargetViewIfEquals(view); | 601 drop_helper_->ResetTargetViewIfEquals(view); |
| 596 } | 602 } |
| 597 | 603 |
| 598 void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name, | |
| 599 void* value) { | |
| 600 if (content_window_) | |
| 601 content_window_->SetNativeWindowProperty(name, value); | |
| 602 } | |
| 603 | |
| 604 void* DesktopNativeWidgetAura::GetNativeWindowProperty(const char* name) const { | 604 void* DesktopNativeWidgetAura::GetNativeWindowProperty(const char* name) const { |
| 605 return content_window_ ? | 605 return content_window_ ? |
| 606 content_window_->GetNativeWindowProperty(name) : NULL; | 606 content_window_->GetNativeWindowProperty(name) : NULL; |
| 607 } | 607 } |
| 608 | 608 |
| 609 TooltipManager* DesktopNativeWidgetAura::GetTooltipManager() const { | 609 TooltipManager* DesktopNativeWidgetAura::GetTooltipManager() const { |
| 610 return tooltip_manager_.get(); | 610 return tooltip_manager_.get(); |
| 611 } | 611 } |
| 612 | 612 |
| 613 void DesktopNativeWidgetAura::SetCapture() { | 613 void DesktopNativeWidgetAura::SetCapture() { |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 if (cursor_reference_count_ == 0) { | 1207 if (cursor_reference_count_ == 0) { |
| 1208 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1208 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
| 1209 // for cleaning up |cursor_manager_|. | 1209 // for cleaning up |cursor_manager_|. |
| 1210 delete cursor_manager_; | 1210 delete cursor_manager_; |
| 1211 native_cursor_manager_ = NULL; | 1211 native_cursor_manager_ = NULL; |
| 1212 cursor_manager_ = NULL; | 1212 cursor_manager_ = NULL; |
| 1213 } | 1213 } |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 } // namespace views | 1216 } // namespace views |
| OLD | NEW |