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

Side by Side Diff: Source/web/PopupContainer.cpp

Issue 453493002: Improve detection of touch events when hiding media controls. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@autoHideControls
Patch Set: Fix build breakage Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011, Google Inc. All rights reserved. 2 * Copyright (c) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 { 286 {
287 return false; 287 return false;
288 } 288 }
289 289
290 // FIXME: Refactor this code to share functionality with 290 // FIXME: Refactor this code to share functionality with
291 // EventHandler::handleGestureEvent. 291 // EventHandler::handleGestureEvent.
292 bool PopupContainer::handleGestureEvent(const PlatformGestureEvent& gestureEvent ) 292 bool PopupContainer::handleGestureEvent(const PlatformGestureEvent& gestureEvent )
293 { 293 {
294 switch (gestureEvent.type()) { 294 switch (gestureEvent.type()) {
295 case PlatformEvent::GestureTap: { 295 case PlatformEvent::GestureTap: {
296 PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.g lobalPosition(), NoButton, PlatformEvent::MouseMoved, /* clickCount */ 1, gestur eEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.m etaKey(), gestureEvent.timestamp()); 296 PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.g lobalPosition(), NoButton, PlatformEvent::MouseMoved, /* clickCount */ 1, gestur eEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.m etaKey(), PlatformMouseEvent::RealOrIndistinguishable, gestureEvent.timestamp()) ;
Rick Byers 2014/08/26 15:25:46 These should be FromTouch (this is GestureTap hand
Ignacio Solla 2014/08/26 17:30:43 Done.
297 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.g lobalPosition(), LeftButton, PlatformEvent::MousePressed, /* clickCount */ 1, ge stureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEve nt.metaKey(), gestureEvent.timestamp()); 297 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.g lobalPosition(), LeftButton, PlatformEvent::MousePressed, /* clickCount */ 1, ge stureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEve nt.metaKey(), PlatformMouseEvent::RealOrIndistinguishable, gestureEvent.timestam p());
298 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.glo balPosition(), LeftButton, PlatformEvent::MouseReleased, /* clickCount */ 1, ges tureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEven t.metaKey(), gestureEvent.timestamp()); 298 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.glo balPosition(), LeftButton, PlatformEvent::MouseReleased, /* clickCount */ 1, ges tureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEven t.metaKey(), PlatformMouseEvent::RealOrIndistinguishable, gestureEvent.timestamp ());
299 // handleMouseMoveEvent(fakeMouseMove); 299 // handleMouseMoveEvent(fakeMouseMove);
300 handleMouseDownEvent(fakeMouseDown); 300 handleMouseDownEvent(fakeMouseDown);
301 handleMouseReleaseEvent(fakeMouseUp); 301 handleMouseReleaseEvent(fakeMouseUp);
302 return true; 302 return true;
303 } 303 }
304 case PlatformEvent::GestureScrollUpdate: 304 case PlatformEvent::GestureScrollUpdate:
305 case PlatformEvent::GestureScrollUpdateWithoutPropagation: { 305 case PlatformEvent::GestureScrollUpdateWithoutPropagation: {
306 PlatformWheelEvent syntheticWheelEvent(gestureEvent.position(), gestureE vent.globalPosition(), gestureEvent.deltaX(), gestureEvent.deltaY(), gestureEven t.deltaX() / 120.0f, gestureEvent.deltaY() / 120.0f, ScrollByPixelWheelEvent, ge stureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEve nt.metaKey()); 306 PlatformWheelEvent syntheticWheelEvent(gestureEvent.position(), gestureE vent.globalPosition(), gestureEvent.deltaX(), gestureEvent.deltaY(), gestureEven t.deltaX() / 120.0f, gestureEvent.deltaY() / 120.0f, ScrollByPixelWheelEvent, ge stureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEve nt.metaKey());
307 handleWheelEvent(syntheticWheelEvent); 307 handleWheelEvent(syntheticWheelEvent);
308 return true; 308 return true;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 } 508 }
509 509
510 info->itemHeight = menuItemHeight(); 510 info->itemHeight = menuItemHeight();
511 info->itemFontSize = menuItemFontSize(); 511 info->itemFontSize = menuItemFontSize();
512 info->selectedIndex = selectedIndex(); 512 info->selectedIndex = selectedIndex();
513 info->items.swap(outputItems); 513 info->items.swap(outputItems);
514 info->rightAligned = menuStyle().textDirection() == RTL; 514 info->rightAligned = menuStyle().textDirection() == RTL;
515 } 515 }
516 516
517 } // namespace blink 517 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698