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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
863 | 863 |
864 void DesktopNativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { | 864 void DesktopNativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { |
865 cursor_ = cursor; | 865 cursor_ = cursor; |
866 aura::client::CursorClient* cursor_client = | 866 aura::client::CursorClient* cursor_client = |
867 aura::client::GetCursorClient(host_->window()); | 867 aura::client::GetCursorClient(host_->window()); |
868 if (cursor_client) | 868 if (cursor_client) |
869 cursor_client->SetCursor(cursor); | 869 cursor_client->SetCursor(cursor); |
870 } | 870 } |
871 | 871 |
872 bool DesktopNativeWidgetAura::IsMouseEventsEnabled() const { | 872 bool DesktopNativeWidgetAura::IsMouseEventsEnabled() const { |
873 if (!content_window_) | 873 if (!content_window_ || !host_) |
sky
2015/01/24 00:00:36
This has me worried, and at the least is worth a c
Devlin
2015/01/24 00:11:48
Yeah, I'm not real keen on it either.
Reason:
- On
| |
874 return false; | 874 return false; |
875 aura::client::CursorClient* cursor_client = | 875 aura::client::CursorClient* cursor_client = |
876 aura::client::GetCursorClient(host_->window()); | 876 aura::client::GetCursorClient(host_->window()); |
877 return cursor_client ? cursor_client->IsMouseEventsEnabled() : true; | 877 return cursor_client ? cursor_client->IsMouseEventsEnabled() : true; |
878 } | 878 } |
879 | 879 |
880 void DesktopNativeWidgetAura::ClearNativeFocus() { | 880 void DesktopNativeWidgetAura::ClearNativeFocus() { |
881 desktop_window_tree_host_->ClearNativeFocus(); | 881 desktop_window_tree_host_->ClearNativeFocus(); |
882 | 882 |
883 if (ShouldActivate()) { | 883 if (ShouldActivate()) { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1229 if (cursor_reference_count_ == 0) { | 1229 if (cursor_reference_count_ == 0) { |
1230 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1230 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
1231 // for cleaning up |cursor_manager_|. | 1231 // for cleaning up |cursor_manager_|. |
1232 delete cursor_manager_; | 1232 delete cursor_manager_; |
1233 native_cursor_manager_ = NULL; | 1233 native_cursor_manager_ = NULL; |
1234 cursor_manager_ = NULL; | 1234 cursor_manager_ = NULL; |
1235 } | 1235 } |
1236 } | 1236 } |
1237 | 1237 |
1238 } // namespace views | 1238 } // namespace views |
OLD | NEW |