| 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/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 658 |
| 659 void NativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { | 659 void NativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { |
| 660 cursor_ = cursor; | 660 cursor_ = cursor; |
| 661 aura::client::CursorClient* cursor_client = | 661 aura::client::CursorClient* cursor_client = |
| 662 aura::client::GetCursorClient(window_->GetRootWindow()); | 662 aura::client::GetCursorClient(window_->GetRootWindow()); |
| 663 if (cursor_client) | 663 if (cursor_client) |
| 664 cursor_client->SetCursor(cursor); | 664 cursor_client->SetCursor(cursor); |
| 665 } | 665 } |
| 666 | 666 |
| 667 bool NativeWidgetAura::IsMouseEventsEnabled() const { | 667 bool NativeWidgetAura::IsMouseEventsEnabled() const { |
| 668 if (!window_) | 668 if (!window_ || !window_->GetRootWindow()) |
| 669 return false; | 669 return false; |
| 670 aura::client::CursorClient* cursor_client = | 670 aura::client::CursorClient* cursor_client = |
| 671 aura::client::GetCursorClient(window_->GetRootWindow()); | 671 aura::client::GetCursorClient(window_->GetRootWindow()); |
| 672 return cursor_client ? cursor_client->IsMouseEventsEnabled() : true; | 672 return cursor_client ? cursor_client->IsMouseEventsEnabled() : true; |
| 673 } | 673 } |
| 674 | 674 |
| 675 void NativeWidgetAura::ClearNativeFocus() { | 675 void NativeWidgetAura::ClearNativeFocus() { |
| 676 aura::client::FocusClient* client = aura::client::GetFocusClient(window_); | 676 aura::client::FocusClient* client = aura::client::GetFocusClient(window_); |
| 677 if (window_ && client && window_->Contains(client->GetFocusedWindow())) | 677 if (window_ && client && window_->Contains(client->GetFocusedWindow())) |
| 678 client->ResetFocusWithinActiveWindow(window_); | 678 client->ResetFocusWithinActiveWindow(window_); |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 gfx::NativeView native_view) { | 1189 gfx::NativeView native_view) { |
| 1190 aura::client::CaptureClient* capture_client = | 1190 aura::client::CaptureClient* capture_client = |
| 1191 aura::client::GetCaptureClient(native_view->GetRootWindow()); | 1191 aura::client::GetCaptureClient(native_view->GetRootWindow()); |
| 1192 if (!capture_client) | 1192 if (!capture_client) |
| 1193 return nullptr; | 1193 return nullptr; |
| 1194 return capture_client->GetGlobalCaptureWindow(); | 1194 return capture_client->GetGlobalCaptureWindow(); |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 } // namespace internal | 1197 } // namespace internal |
| 1198 } // namespace views | 1198 } // namespace views |
| OLD | NEW |