| 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/widget.h" | 5 #include "ui/views/widget/widget.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 event->SetHandled(); | 1210 event->SetHandled(); |
| 1211 return; | 1211 return; |
| 1212 | 1212 |
| 1213 case ui::ET_MOUSE_MOVED: | 1213 case ui::ET_MOUSE_MOVED: |
| 1214 case ui::ET_MOUSE_DRAGGED: | 1214 case ui::ET_MOUSE_DRAGGED: |
| 1215 if (native_widget_->HasCapture() && is_mouse_button_pressed_) { | 1215 if (native_widget_->HasCapture() && is_mouse_button_pressed_) { |
| 1216 last_mouse_event_was_move_ = false; | 1216 last_mouse_event_was_move_ = false; |
| 1217 if (root_view) | 1217 if (root_view) |
| 1218 root_view->OnMouseDragged(*event); | 1218 root_view->OnMouseDragged(*event); |
| 1219 } else if (!last_mouse_event_was_move_ || | 1219 } else if (!last_mouse_event_was_move_ || |
| 1220 last_mouse_event_position_ != event->location()) { | 1220 last_mouse_event_position_ != |
| 1221 last_mouse_event_position_ = event->location(); | 1221 gfx::ToFlooredPoint(event->location())) { |
| 1222 last_mouse_event_position_ = gfx::ToFlooredPoint(event->location()); |
| 1222 last_mouse_event_was_move_ = true; | 1223 last_mouse_event_was_move_ = true; |
| 1223 if (root_view) | 1224 if (root_view) |
| 1224 root_view->OnMouseMoved(*event); | 1225 root_view->OnMouseMoved(*event); |
| 1225 } | 1226 } |
| 1226 return; | 1227 return; |
| 1227 | 1228 |
| 1228 case ui::ET_MOUSE_EXITED: | 1229 case ui::ET_MOUSE_EXITED: |
| 1229 last_mouse_event_was_move_ = false; | 1230 last_mouse_event_was_move_ = false; |
| 1230 if (root_view) | 1231 if (root_view) |
| 1231 root_view->OnMouseExited(*event); | 1232 root_view->OnMouseExited(*event); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 | 1486 |
| 1486 //////////////////////////////////////////////////////////////////////////////// | 1487 //////////////////////////////////////////////////////////////////////////////// |
| 1487 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1488 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1488 | 1489 |
| 1489 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1490 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1490 return this; | 1491 return this; |
| 1491 } | 1492 } |
| 1492 | 1493 |
| 1493 } // namespace internal | 1494 } // namespace internal |
| 1494 } // namespace views | 1495 } // namespace views |
| OLD | NEW |