Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: ui/views/widget/widget.cc

Issue 11568006: events: Update scroll and touch handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self-nit Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/widget.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/events/event.h" 10 #include "ui/base/events/event.h"
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 return true; 1166 return true;
1167 } 1167 }
1168 1168
1169 void Widget::OnMouseCaptureLost() { 1169 void Widget::OnMouseCaptureLost() {
1170 if (is_mouse_button_pressed_ || is_touch_down_) 1170 if (is_mouse_button_pressed_ || is_touch_down_)
1171 GetRootView()->OnMouseCaptureLost(); 1171 GetRootView()->OnMouseCaptureLost();
1172 is_touch_down_ = false; 1172 is_touch_down_ = false;
1173 is_mouse_button_pressed_ = false; 1173 is_mouse_button_pressed_ = false;
1174 } 1174 }
1175 1175
1176 ui::EventResult Widget::OnTouchEvent(ui::TouchEvent* event) { 1176 void Widget::OnTouchEvent(ui::TouchEvent* event) {
1177 ScopedEvent scoped(this, *event); 1177 ScopedEvent scoped(this, *event);
1178 return static_cast<internal::RootView*>(GetRootView())-> 1178 static_cast<internal::RootView*>(GetRootView())->
1179 DispatchTouchEvent(event); 1179 DispatchTouchEvent(event);
1180 } 1180 }
1181 1181
1182 ui::EventResult Widget::OnScrollEvent(ui::ScrollEvent* event) { 1182 void Widget::OnScrollEvent(ui::ScrollEvent* event) {
1183 ScopedEvent scoped(this, *event); 1183 ScopedEvent scoped(this, *event);
1184 return static_cast<internal::RootView*>(GetRootView())-> 1184 static_cast<internal::RootView*>(GetRootView())->
1185 DispatchScrollEvent(event); 1185 DispatchScrollEvent(event);
1186 } 1186 }
1187 1187
1188 void Widget::OnGestureEvent(ui::GestureEvent* event) { 1188 void Widget::OnGestureEvent(ui::GestureEvent* event) {
1189 ScopedEvent scoped(this, *event); 1189 ScopedEvent scoped(this, *event);
1190 switch (event->type()) { 1190 switch (event->type()) {
1191 case ui::ET_GESTURE_TAP_DOWN: 1191 case ui::ET_GESTURE_TAP_DOWN:
1192 is_touch_down_ = true; 1192 is_touch_down_ = true;
1193 // We explicitly don't capture here. Not capturing enables multiple 1193 // We explicitly don't capture here. Not capturing enables multiple
1194 // widgets to get tap events at the same time. Views (such as tab 1194 // widgets to get tap events at the same time. Views (such as tab
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 1386
1387 //////////////////////////////////////////////////////////////////////////////// 1387 ////////////////////////////////////////////////////////////////////////////////
1388 // internal::NativeWidgetPrivate, NativeWidget implementation: 1388 // internal::NativeWidgetPrivate, NativeWidget implementation:
1389 1389
1390 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1390 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1391 return this; 1391 return this;
1392 } 1392 }
1393 1393
1394 } // namespace internal 1394 } // namespace internal
1395 } // namespace views 1395 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698