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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 10912063: events: Get rid of GestureStatus in favour of EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 months 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
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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 // touch-event handler in the page. 1290 // touch-event handler in the page.
1291 if (point && host_->has_touch_handler()) { 1291 if (point && host_->has_touch_handler()) {
1292 host_->ForwardTouchEvent(touch_event_); 1292 host_->ForwardTouchEvent(touch_event_);
1293 UpdateWebTouchEventAfterDispatch(&touch_event_, point); 1293 UpdateWebTouchEventAfterDispatch(&touch_event_, point);
1294 return DecideTouchStatus(touch_event_, point); 1294 return DecideTouchStatus(touch_event_, point);
1295 } 1295 }
1296 1296
1297 return ui::TOUCH_STATUS_UNKNOWN; 1297 return ui::TOUCH_STATUS_UNKNOWN;
1298 } 1298 }
1299 1299
1300 ui::GestureStatus RenderWidgetHostViewAura::OnGestureEvent( 1300 ui::EventResult RenderWidgetHostViewAura::OnGestureEvent(
1301 ui::GestureEvent* event) { 1301 ui::GestureEvent* event) {
1302 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnGestureEvent"); 1302 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnGestureEvent");
1303 // Pinch gestures are currently disabled by default. See crbug.com/128477. 1303 // Pinch gestures are currently disabled by default. See crbug.com/128477.
1304 if ((event->type() == ui::ET_GESTURE_PINCH_BEGIN || 1304 if ((event->type() == ui::ET_GESTURE_PINCH_BEGIN ||
1305 event->type() == ui::ET_GESTURE_PINCH_UPDATE || 1305 event->type() == ui::ET_GESTURE_PINCH_UPDATE ||
1306 event->type() == ui::ET_GESTURE_PINCH_END) && !ShouldSendPinchGesture()) { 1306 event->type() == ui::ET_GESTURE_PINCH_END) && !ShouldSendPinchGesture()) {
1307 return ui::GESTURE_STATUS_CONSUMED; 1307 return ui::ER_CONSUMED;
1308 } 1308 }
1309 1309
1310 RenderViewHostDelegate* delegate = NULL; 1310 RenderViewHostDelegate* delegate = NULL;
1311 if (popup_type_ == WebKit::WebPopupTypeNone && !is_fullscreen_) 1311 if (popup_type_ == WebKit::WebPopupTypeNone && !is_fullscreen_)
1312 delegate = RenderViewHost::From(host_)->GetDelegate(); 1312 delegate = RenderViewHost::From(host_)->GetDelegate();
1313 if (delegate && event->type() == ui::ET_GESTURE_BEGIN && 1313 if (delegate && event->type() == ui::ET_GESTURE_BEGIN &&
1314 event->details().touch_points() == 1) { 1314 event->details().touch_points() == 1) {
1315 delegate->HandleGestureBegin(); 1315 delegate->HandleGestureBegin();
1316 } 1316 }
1317 1317
(...skipping 20 matching lines...) Expand all
1338 1338
1339 if (delegate && event->type() == ui::ET_GESTURE_END && 1339 if (delegate && event->type() == ui::ET_GESTURE_END &&
1340 event->details().touch_points() == 1) { 1340 event->details().touch_points() == 1) {
1341 delegate->HandleGestureEnd(); 1341 delegate->HandleGestureEnd();
1342 } 1342 }
1343 1343
1344 // If a gesture is not processed by the webpage, then WebKit processes it 1344 // If a gesture is not processed by the webpage, then WebKit processes it
1345 // (e.g. generates synthetic mouse events). So CONSUMED should be returned 1345 // (e.g. generates synthetic mouse events). So CONSUMED should be returned
1346 // from here to avoid any duplicate synthetic mouse-events being generated 1346 // from here to avoid any duplicate synthetic mouse-events being generated
1347 // from aura. 1347 // from aura.
1348 return ui::GESTURE_STATUS_CONSUMED; 1348 return ui::ER_CONSUMED;
1349 } 1349 }
1350 1350
1351 bool RenderWidgetHostViewAura::CanFocus() { 1351 bool RenderWidgetHostViewAura::CanFocus() {
1352 return popup_type_ == WebKit::WebPopupTypeNone; 1352 return popup_type_ == WebKit::WebPopupTypeNone;
1353 } 1353 }
1354 1354
1355 void RenderWidgetHostViewAura::OnCaptureLost() { 1355 void RenderWidgetHostViewAura::OnCaptureLost() {
1356 host_->LostCapture(); 1356 host_->LostCapture();
1357 } 1357 }
1358 1358
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 RenderWidgetHost* widget) { 1659 RenderWidgetHost* widget) {
1660 return new RenderWidgetHostViewAura(widget); 1660 return new RenderWidgetHostViewAura(widget);
1661 } 1661 }
1662 1662
1663 // static 1663 // static
1664 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 1664 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
1665 GetScreenInfoForWindow(results, NULL); 1665 GetScreenInfoForWindow(results, NULL);
1666 } 1666 }
1667 1667
1668 } // namespace content 1668 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | content/browser/web_contents/web_contents_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698