OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |