| 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" | |
| 49 #include "PlatformWheelEvent.h" | 48 #include "PlatformWheelEvent.h" |
| 50 #include "PopupListBox.h" | 49 #include "PopupListBox.h" |
| 51 #include "PopupMenuClient.h" | 50 #include "PopupMenuClient.h" |
| 52 #include "UserGestureIndicator.h" | 51 #include "UserGestureIndicator.h" |
| 53 #include <limits> | 52 #include <limits> |
| 54 | 53 |
| 54 #if ENABLE(TOUCH_EVENTS) |
| 55 #include "PlatformTouchEvent.h" |
| 56 #endif |
| 57 |
| 55 using namespace std; | 58 using namespace std; |
| 56 | 59 |
| 57 namespace WebCore { | 60 namespace WebCore { |
| 58 | 61 |
| 59 static const int kBorderSize = 1; | 62 static const int kBorderSize = 1; |
| 60 | 63 |
| 61 static PlatformMouseEvent constructRelativeMouseEvent(const PlatformMouseEvent&
e, | 64 static PlatformMouseEvent constructRelativeMouseEvent(const PlatformMouseEvent&
e, |
| 62 FramelessScrollView* paren
t, | 65 FramelessScrollView* paren
t, |
| 63 FramelessScrollView* child
) | 66 FramelessScrollView* child
) |
| 64 { | 67 { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 constructRelativeMouseEvent(event, this, m_listBox.get())); | 286 constructRelativeMouseEvent(event, this, m_listBox.get())); |
| 284 } | 287 } |
| 285 | 288 |
| 286 bool PopupContainer::handleWheelEvent(const PlatformWheelEvent& event) | 289 bool PopupContainer::handleWheelEvent(const PlatformWheelEvent& event) |
| 287 { | 290 { |
| 288 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | 291 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); |
| 289 return m_listBox->handleWheelEvent( | 292 return m_listBox->handleWheelEvent( |
| 290 constructRelativeWheelEvent(event, this, m_listBox.get())); | 293 constructRelativeWheelEvent(event, this, m_listBox.get())); |
| 291 } | 294 } |
| 292 | 295 |
| 296 #if ENABLE(TOUCH_EVENTS) |
| 293 bool PopupContainer::handleTouchEvent(const PlatformTouchEvent&) | 297 bool PopupContainer::handleTouchEvent(const PlatformTouchEvent&) |
| 294 { | 298 { |
| 295 return false; | 299 return false; |
| 296 } | 300 } |
| 301 #endif |
| 297 | 302 |
| 298 // FIXME: Refactor this code to share functionality with EventHandler::handleGes
tureEvent. | 303 // FIXME: Refactor this code to share functionality with EventHandler::handleGes
tureEvent. |
| 299 bool PopupContainer::handleGestureEvent(const PlatformGestureEvent& gestureEvent
) | 304 bool PopupContainer::handleGestureEvent(const PlatformGestureEvent& gestureEvent
) |
| 300 { | 305 { |
| 301 switch (gestureEvent.type()) { | 306 switch (gestureEvent.type()) { |
| 302 case PlatformEvent::GestureTap: { | 307 case PlatformEvent::GestureTap: { |
| 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()); | 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()); |
| 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()); | 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()); |
| 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()); | 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()); |
| 306 // handleMouseMoveEvent(fakeMouseMove); | 311 // handleMouseMoveEvent(fakeMouseMove); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 463 } |
| 459 | 464 |
| 460 String PopupContainer::getSelectedItemToolTip() | 465 String PopupContainer::getSelectedItemToolTip() |
| 461 { | 466 { |
| 462 // We cannot use m_popupClient->selectedIndex() to choose tooltip message, | 467 // We cannot use m_popupClient->selectedIndex() to choose tooltip message, |
| 463 // because the selectedIndex() might return final selected index, not hoveri
ng selection. | 468 // because the selectedIndex() might return final selected index, not hoveri
ng selection. |
| 464 return listBox()->m_popupClient->itemToolTip(listBox()->m_selectedIndex); | 469 return listBox()->m_popupClient->itemToolTip(listBox()->m_selectedIndex); |
| 465 } | 470 } |
| 466 | 471 |
| 467 } // namespace WebCore | 472 } // namespace WebCore |
| OLD | NEW |