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 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 case ui::ET_GESTURE_TAP_DOWN: | 1104 case ui::ET_GESTURE_TAP_DOWN: |
1105 is_touch_down_ = true; | 1105 is_touch_down_ = true; |
1106 // We explicitly don't capture here. Not capturing enables multiple | 1106 // We explicitly don't capture here. Not capturing enables multiple |
1107 // widgets to get tap events at the same time. Views (such as tab | 1107 // widgets to get tap events at the same time. Views (such as tab |
1108 // dragging) may explicitly capture. | 1108 // dragging) may explicitly capture. |
1109 break; | 1109 break; |
1110 | 1110 |
1111 case ui::ET_GESTURE_END: | 1111 case ui::ET_GESTURE_END: |
1112 if (event.delta_x() == 1) { | 1112 if (event.delta_x() == 1) { |
1113 is_touch_down_ = false; | 1113 is_touch_down_ = false; |
1114 ReleaseCapture(); | 1114 if (ShouldReleaseCaptureOnMouseReleased()) |
| 1115 ReleaseCapture(); |
1115 } | 1116 } |
1116 break; | 1117 break; |
1117 | 1118 |
1118 default: | 1119 default: |
1119 break; | 1120 break; |
1120 } | 1121 } |
1121 return GetRootView()->OnGestureEvent(event); | 1122 return GetRootView()->OnGestureEvent(event); |
1122 } | 1123 } |
1123 | 1124 |
1124 bool Widget::ExecuteCommand(int command_id) { | 1125 bool Widget::ExecuteCommand(int command_id) { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 | 1281 |
1281 //////////////////////////////////////////////////////////////////////////////// | 1282 //////////////////////////////////////////////////////////////////////////////// |
1282 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1283 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1283 | 1284 |
1284 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1285 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1285 return this; | 1286 return this; |
1286 } | 1287 } |
1287 | 1288 |
1288 } // namespace internal | 1289 } // namespace internal |
1289 } // namespace views | 1290 } // namespace views |
OLD | NEW |