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

Side by Side Diff: Source/core/platform/chromium/PopupContainer.cpp

Issue 14296003: Remove TOUCH_EVENTS and TOUCH_EVENT_TRACKING compile-time flags. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase. Created 7 years, 8 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 /* 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 27 matching lines...) Expand all
38 #include "FrameView.h" 38 #include "FrameView.h"
39 #include "FramelessScrollView.h" 39 #include "FramelessScrollView.h"
40 #include "FramelessScrollViewClient.h" 40 #include "FramelessScrollViewClient.h"
41 #include "GraphicsContext.h" 41 #include "GraphicsContext.h"
42 #include "IntRect.h" 42 #include "IntRect.h"
43 #include "Page.h" 43 #include "Page.h"
44 #include "PlatformGestureEvent.h" 44 #include "PlatformGestureEvent.h"
45 #include "PlatformKeyboardEvent.h" 45 #include "PlatformKeyboardEvent.h"
46 #include "PlatformMouseEvent.h" 46 #include "PlatformMouseEvent.h"
47 #include "PlatformScreen.h" 47 #include "PlatformScreen.h"
48 #include "PlatformTouchEvent.h"
48 #include "PlatformWheelEvent.h" 49 #include "PlatformWheelEvent.h"
49 #include "PopupListBox.h" 50 #include "PopupListBox.h"
50 #include "PopupMenuClient.h" 51 #include "PopupMenuClient.h"
51 #include "UserGestureIndicator.h" 52 #include "UserGestureIndicator.h"
52 #include <limits> 53 #include <limits>
53 54
54 #if ENABLE(TOUCH_EVENTS)
55 #include "PlatformTouchEvent.h"
56 #endif
57
58 using namespace std; 55 using namespace std;
59 56
60 namespace WebCore { 57 namespace WebCore {
61 58
62 static const int kBorderSize = 1; 59 static const int kBorderSize = 1;
63 60
64 static PlatformMouseEvent constructRelativeMouseEvent(const PlatformMouseEvent& e, 61 static PlatformMouseEvent constructRelativeMouseEvent(const PlatformMouseEvent& e,
65 FramelessScrollView* paren t, 62 FramelessScrollView* paren t,
66 FramelessScrollView* child ) 63 FramelessScrollView* child )
67 { 64 {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 constructRelativeMouseEvent(event, this, m_listBox.get())); 283 constructRelativeMouseEvent(event, this, m_listBox.get()));
287 } 284 }
288 285
289 bool PopupContainer::handleWheelEvent(const PlatformWheelEvent& event) 286 bool PopupContainer::handleWheelEvent(const PlatformWheelEvent& event)
290 { 287 {
291 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); 288 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
292 return m_listBox->handleWheelEvent( 289 return m_listBox->handleWheelEvent(
293 constructRelativeWheelEvent(event, this, m_listBox.get())); 290 constructRelativeWheelEvent(event, this, m_listBox.get()));
294 } 291 }
295 292
296 #if ENABLE(TOUCH_EVENTS)
297 bool PopupContainer::handleTouchEvent(const PlatformTouchEvent&) 293 bool PopupContainer::handleTouchEvent(const PlatformTouchEvent&)
298 { 294 {
299 return false; 295 return false;
300 } 296 }
301 #endif
302 297
303 // FIXME: Refactor this code to share functionality with EventHandler::handleGes tureEvent. 298 // FIXME: Refactor this code to share functionality with EventHandler::handleGes tureEvent.
304 bool PopupContainer::handleGestureEvent(const PlatformGestureEvent& gestureEvent ) 299 bool PopupContainer::handleGestureEvent(const PlatformGestureEvent& gestureEvent )
305 { 300 {
306 switch (gestureEvent.type()) { 301 switch (gestureEvent.type()) {
307 case PlatformEvent::GestureTap: { 302 case PlatformEvent::GestureTap: {
308 PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.g lobalPosition(), NoButton, PlatformEvent::MouseMoved, /* clickCount */ 1, gestur eEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.m etaKey(), gestureEvent.timestamp()); 303 PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.g lobalPosition(), NoButton, PlatformEvent::MouseMoved, /* clickCount */ 1, gestur eEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.m etaKey(), gestureEvent.timestamp());
309 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.g lobalPosition(), LeftButton, PlatformEvent::MousePressed, /* clickCount */ 1, ge stureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEve nt.metaKey(), gestureEvent.timestamp()); 304 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.g lobalPosition(), LeftButton, PlatformEvent::MousePressed, /* clickCount */ 1, ge stureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEve nt.metaKey(), gestureEvent.timestamp());
310 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.glo balPosition(), LeftButton, PlatformEvent::MouseReleased, /* clickCount */ 1, ges tureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEven t.metaKey(), gestureEvent.timestamp()); 305 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.glo balPosition(), LeftButton, PlatformEvent::MouseReleased, /* clickCount */ 1, ges tureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEven t.metaKey(), gestureEvent.timestamp());
311 // handleMouseMoveEvent(fakeMouseMove); 306 // handleMouseMoveEvent(fakeMouseMove);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 } 458 }
464 459
465 String PopupContainer::getSelectedItemToolTip() 460 String PopupContainer::getSelectedItemToolTip()
466 { 461 {
467 // We cannot use m_popupClient->selectedIndex() to choose tooltip message, 462 // We cannot use m_popupClient->selectedIndex() to choose tooltip message,
468 // because the selectedIndex() might return final selected index, not hoveri ng selection. 463 // because the selectedIndex() might return final selected index, not hoveri ng selection.
469 return listBox()->m_popupClient->itemToolTip(listBox()->m_selectedIndex); 464 return listBox()->m_popupClient->itemToolTip(listBox()->m_selectedIndex);
470 } 465 }
471 466
472 } // namespace WebCore 467 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/chromium/PopupContainer.h ('k') | Source/core/platform/chromium/PopupListBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698