| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 // deactivated (child widgets don't get native desktop activation changes, | 382 // deactivated (child widgets don't get native desktop activation changes, |
| 383 // only aura activation changes). | 383 // only aura activation changes). |
| 384 aura::Window* active_window = activation_client->GetActiveWindow(); | 384 aura::Window* active_window = activation_client->GetActiveWindow(); |
| 385 if (active_window) { | 385 if (active_window) { |
| 386 activation_client->DeactivateWindow(active_window); | 386 activation_client->DeactivateWindow(active_window); |
| 387 GetInputMethod()->OnBlur(); | 387 GetInputMethod()->OnBlur(); |
| 388 } | 388 } |
| 389 } | 389 } |
| 390 } | 390 } |
| 391 | 391 |
| 392 gfx::NativeWindow DesktopNativeWidgetAura::GetNativeWindow() const { |
| 393 return content_window_; |
| 394 } |
| 395 |
| 392 //////////////////////////////////////////////////////////////////////////////// | 396 //////////////////////////////////////////////////////////////////////////////// |
| 393 // DesktopNativeWidgetAura, internal::NativeWidgetPrivate implementation: | 397 // DesktopNativeWidgetAura, internal::NativeWidgetPrivate implementation: |
| 394 | 398 |
| 395 void DesktopNativeWidgetAura::InitNativeWidget( | 399 void DesktopNativeWidgetAura::InitNativeWidget( |
| 396 const Widget::InitParams& params) { | 400 const Widget::InitParams& params) { |
| 397 ownership_ = params.ownership; | 401 ownership_ = params.ownership; |
| 398 widget_type_ = params.type; | 402 widget_type_ = params.type; |
| 399 name_ = params.name; | 403 name_ = params.name; |
| 400 | 404 |
| 401 NativeWidgetAura::RegisterNativeWidgetForWindow(this, content_window_); | 405 NativeWidgetAura::RegisterNativeWidgetForWindow(this, content_window_); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } | 560 } |
| 557 | 561 |
| 558 const Widget* DesktopNativeWidgetAura::GetWidget() const { | 562 const Widget* DesktopNativeWidgetAura::GetWidget() const { |
| 559 return native_widget_delegate_->AsWidget(); | 563 return native_widget_delegate_->AsWidget(); |
| 560 } | 564 } |
| 561 | 565 |
| 562 gfx::NativeView DesktopNativeWidgetAura::GetNativeView() const { | 566 gfx::NativeView DesktopNativeWidgetAura::GetNativeView() const { |
| 563 return content_window_; | 567 return content_window_; |
| 564 } | 568 } |
| 565 | 569 |
| 566 gfx::NativeWindow DesktopNativeWidgetAura::GetNativeWindow() const { | |
| 567 return content_window_; | |
| 568 } | |
| 569 | |
| 570 Widget* DesktopNativeWidgetAura::GetTopLevelWidget() { | 570 Widget* DesktopNativeWidgetAura::GetTopLevelWidget() { |
| 571 return GetWidget(); | 571 return GetWidget(); |
| 572 } | 572 } |
| 573 | 573 |
| 574 const ui::Compositor* DesktopNativeWidgetAura::GetCompositor() const { | 574 const ui::Compositor* DesktopNativeWidgetAura::GetCompositor() const { |
| 575 return content_window_ ? content_window_->layer()->GetCompositor() : NULL; | 575 return content_window_ ? content_window_->layer()->GetCompositor() : NULL; |
| 576 } | 576 } |
| 577 | 577 |
| 578 const ui::Layer* DesktopNativeWidgetAura::GetLayer() const { | 578 const ui::Layer* DesktopNativeWidgetAura::GetLayer() const { |
| 579 return content_window_ ? content_window_->layer() : NULL; | 579 return content_window_ ? content_window_->layer() : NULL; |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 if (cursor_reference_count_ == 0) { | 1197 if (cursor_reference_count_ == 0) { |
| 1198 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1198 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
| 1199 // for cleaning up |cursor_manager_|. | 1199 // for cleaning up |cursor_manager_|. |
| 1200 delete cursor_manager_; | 1200 delete cursor_manager_; |
| 1201 native_cursor_manager_ = NULL; | 1201 native_cursor_manager_ = NULL; |
| 1202 cursor_manager_ = NULL; | 1202 cursor_manager_ = NULL; |
| 1203 } | 1203 } |
| 1204 } | 1204 } |
| 1205 | 1205 |
| 1206 } // namespace views | 1206 } // namespace views |
| OLD | NEW |