| 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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 if (key.handled() || !focus_manager) | 1094 if (key.handled() || !focus_manager) |
| 1095 return; | 1095 return; |
| 1096 focus_manager->OnKeyEvent(key); | 1096 focus_manager->OnKeyEvent(key); |
| 1097 } | 1097 } |
| 1098 | 1098 |
| 1099 //////////////////////////////////////////////////////////////////////////////// | 1099 //////////////////////////////////////////////////////////////////////////////// |
| 1100 // DesktopNativeWidgetAura, aura::WindowDragDropDelegate implementation: | 1100 // DesktopNativeWidgetAura, aura::WindowDragDropDelegate implementation: |
| 1101 | 1101 |
| 1102 void DesktopNativeWidgetAura::OnDragEntered(const ui::DropTargetEvent& event) { | 1102 void DesktopNativeWidgetAura::OnDragEntered(const ui::DropTargetEvent& event) { |
| 1103 DCHECK(drop_helper_.get() != NULL); | 1103 DCHECK(drop_helper_.get() != NULL); |
| 1104 last_drop_operation_ = drop_helper_->OnDragOver(event.data(), | 1104 last_drop_operation_ = |
| 1105 event.location(), event.source_operations()); | 1105 drop_helper_->OnDragOver(event.data(), |
| 1106 gfx::ToFlooredPoint(event.location()), |
| 1107 event.source_operations()); |
| 1106 } | 1108 } |
| 1107 | 1109 |
| 1108 int DesktopNativeWidgetAura::OnDragUpdated(const ui::DropTargetEvent& event) { | 1110 int DesktopNativeWidgetAura::OnDragUpdated(const ui::DropTargetEvent& event) { |
| 1109 DCHECK(drop_helper_.get() != NULL); | 1111 DCHECK(drop_helper_.get() != NULL); |
| 1110 last_drop_operation_ = drop_helper_->OnDragOver(event.data(), | 1112 last_drop_operation_ = |
| 1111 event.location(), event.source_operations()); | 1113 drop_helper_->OnDragOver(event.data(), |
| 1114 gfx::ToFlooredPoint(event.location()), |
| 1115 event.source_operations()); |
| 1112 return last_drop_operation_; | 1116 return last_drop_operation_; |
| 1113 } | 1117 } |
| 1114 | 1118 |
| 1115 void DesktopNativeWidgetAura::OnDragExited() { | 1119 void DesktopNativeWidgetAura::OnDragExited() { |
| 1116 DCHECK(drop_helper_.get() != NULL); | 1120 DCHECK(drop_helper_.get() != NULL); |
| 1117 drop_helper_->OnDragExit(); | 1121 drop_helper_->OnDragExit(); |
| 1118 } | 1122 } |
| 1119 | 1123 |
| 1120 int DesktopNativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { | 1124 int DesktopNativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { |
| 1121 DCHECK(drop_helper_.get() != NULL); | 1125 DCHECK(drop_helper_.get() != NULL); |
| 1122 Activate(); | 1126 Activate(); |
| 1123 return drop_helper_->OnDrop(event.data(), event.location(), | 1127 return drop_helper_->OnDrop(event.data(), |
| 1124 last_drop_operation_); | 1128 gfx::ToFlooredPoint(event.location()), |
| 1129 last_drop_operation_); |
| 1125 } | 1130 } |
| 1126 | 1131 |
| 1127 //////////////////////////////////////////////////////////////////////////////// | 1132 //////////////////////////////////////////////////////////////////////////////// |
| 1128 // DesktopNativeWidgetAura, aura::WindowTreeHostObserver implementation: | 1133 // DesktopNativeWidgetAura, aura::WindowTreeHostObserver implementation: |
| 1129 | 1134 |
| 1130 void DesktopNativeWidgetAura::OnHostCloseRequested( | 1135 void DesktopNativeWidgetAura::OnHostCloseRequested( |
| 1131 const aura::WindowTreeHost* host) { | 1136 const aura::WindowTreeHost* host) { |
| 1132 GetWidget()->Close(); | 1137 GetWidget()->Close(); |
| 1133 } | 1138 } |
| 1134 | 1139 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 if (cursor_reference_count_ == 0) { | 1191 if (cursor_reference_count_ == 0) { |
| 1187 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1192 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
| 1188 // for cleaning up |cursor_manager_|. | 1193 // for cleaning up |cursor_manager_|. |
| 1189 delete cursor_manager_; | 1194 delete cursor_manager_; |
| 1190 native_cursor_manager_ = NULL; | 1195 native_cursor_manager_ = NULL; |
| 1191 cursor_manager_ = NULL; | 1196 cursor_manager_ = NULL; |
| 1192 } | 1197 } |
| 1193 } | 1198 } |
| 1194 | 1199 |
| 1195 } // namespace views | 1200 } // namespace views |
| OLD | NEW |