| 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
| (...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 ui::GestureStatus Widget::OnGestureEvent(const GestureEvent& event) { | 1109 ui::GestureStatus Widget::OnGestureEvent(const GestureEvent& event) { |
| 1110 ScopedEvent scoped(this, event); | 1110 ScopedEvent scoped(this, event); |
| 1111 switch (event.type()) { | 1111 switch (event.type()) { |
| 1112 case ui::ET_GESTURE_TAP_DOWN: | 1112 case ui::ET_GESTURE_TAP_DOWN: |
| 1113 is_touch_down_ = true; | 1113 is_touch_down_ = true; |
| 1114 // We explicitly don't capture here. Not capturing enables multiple | 1114 // We explicitly don't capture here. Not capturing enables multiple |
| 1115 // widgets to get tap events at the same time. Views (such as tab | 1115 // widgets to get tap events at the same time. Views (such as tab |
| 1116 // dragging) may explicitly capture. | 1116 // dragging) may explicitly capture. |
| 1117 break; | 1117 break; |
| 1118 | 1118 |
| 1119 case ui::ET_GESTURE_END: | 1119 case ui::ET_GESTURE_TAP_UP: |
| 1120 if (event.delta_x() == 1) { | 1120 is_touch_down_ = false; |
| 1121 is_touch_down_ = false; | 1121 ReleaseCapture(); |
| 1122 ReleaseCapture(); | |
| 1123 } | |
| 1124 break; | 1122 break; |
| 1125 | 1123 |
| 1126 default: | 1124 default: |
| 1127 break; | 1125 break; |
| 1128 } | 1126 } |
| 1129 return GetRootView()->OnGestureEvent(event); | 1127 return GetRootView()->OnGestureEvent(event); |
| 1130 } | 1128 } |
| 1131 | 1129 |
| 1132 bool Widget::ExecuteCommand(int command_id) { | 1130 bool Widget::ExecuteCommand(int command_id) { |
| 1133 return widget_delegate_->ExecuteWindowsCommand(command_id); | 1131 return widget_delegate_->ExecuteWindowsCommand(command_id); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 | 1286 |
| 1289 //////////////////////////////////////////////////////////////////////////////// | 1287 //////////////////////////////////////////////////////////////////////////////// |
| 1290 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1288 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1291 | 1289 |
| 1292 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1290 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1293 return this; | 1291 return this; |
| 1294 } | 1292 } |
| 1295 | 1293 |
| 1296 } // namespace internal | 1294 } // namespace internal |
| 1297 } // namespace views | 1295 } // namespace views |
| OLD | NEW |