Chromium Code Reviews| 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/activation_client.h" | 9 #include "ui/aura/client/activation_client.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 938 if (GetWidget()->HasFocusManager() && | 938 if (GetWidget()->HasFocusManager() && |
| 939 !GetWidget()->GetFocusManager()->OnKeyEvent(*event)) | 939 !GetWidget()->GetFocusManager()->OnKeyEvent(*event)) |
| 940 event->SetHandled(); | 940 event->SetHandled(); |
| 941 } | 941 } |
| 942 | 942 |
| 943 void DesktopNativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) { | 943 void DesktopNativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) { |
| 944 DCHECK(content_window_->IsVisible()); | 944 DCHECK(content_window_->IsVisible()); |
| 945 if (tooltip_manager_.get()) | 945 if (tooltip_manager_.get()) |
| 946 tooltip_manager_->UpdateTooltip(); | 946 tooltip_manager_->UpdateTooltip(); |
| 947 TooltipManagerAura::UpdateTooltipManagerForCapture(GetWidget()); | 947 TooltipManagerAura::UpdateTooltipManagerForCapture(GetWidget()); |
| 948 // This is required because the cursor is a per-thread property on Windows | |
| 949 // (not a per-window). We don't respond to WM_SETCURSOR, but instead rely on | |
| 950 // the cursor_client to call ::SetCursor appropriately. If we don't clear | |
| 951 // the cursor on exiting the widget, then the next time, the cursor client | |
| 952 // will not call ::SetCursor appropriately because it will believe it's | |
| 953 // already set the cursor for the window (and there's a cursor client per | |
|
sky
2013/11/22 21:26:47
Why does the cursor client think it's already set
| |
| 954 // created per window). | |
| 955 if (event->type() == ui::ET_MOUSE_EXITED) | |
| 956 cursor_client_->SetCursor(ui::kCursorNull); | |
| 948 native_widget_delegate_->OnMouseEvent(event); | 957 native_widget_delegate_->OnMouseEvent(event); |
| 949 // WARNING: we may have been deleted. | 958 // WARNING: we may have been deleted. |
| 950 } | 959 } |
| 951 | 960 |
| 952 void DesktopNativeWidgetAura::OnScrollEvent(ui::ScrollEvent* event) { | 961 void DesktopNativeWidgetAura::OnScrollEvent(ui::ScrollEvent* event) { |
| 953 if (event->type() == ui::ET_SCROLL) { | 962 if (event->type() == ui::ET_SCROLL) { |
| 954 native_widget_delegate_->OnScrollEvent(event); | 963 native_widget_delegate_->OnScrollEvent(event); |
| 955 if (event->handled()) | 964 if (event->handled()) |
| 956 return; | 965 return; |
| 957 | 966 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1112 input_method_event_filter_->SetInputMethodPropertyInRootWindow( | 1121 input_method_event_filter_->SetInputMethodPropertyInRootWindow( |
| 1113 root_window_->window()); | 1122 root_window_->window()); |
| 1114 root_window_event_filter_->AddHandler(input_method_event_filter_.get()); | 1123 root_window_event_filter_->AddHandler(input_method_event_filter_.get()); |
| 1115 } | 1124 } |
| 1116 | 1125 |
| 1117 void DesktopNativeWidgetAura::UpdateWindowTransparency() { | 1126 void DesktopNativeWidgetAura::UpdateWindowTransparency() { |
| 1118 content_window_->SetTransparent(ShouldUseNativeFrame()); | 1127 content_window_->SetTransparent(ShouldUseNativeFrame()); |
| 1119 } | 1128 } |
| 1120 | 1129 |
| 1121 } // namespace views | 1130 } // namespace views |
| OLD | NEW |