OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 // FIXME: Add context menu support (Windows). | 715 // FIXME: Add context menu support (Windows). |
716 } | 716 } |
717 | 717 |
718 bool WebFrameWidgetImpl::handleMouseWheel(LocalFrame& mainFrame, const WebMouseW
heelEvent& event) | 718 bool WebFrameWidgetImpl::handleMouseWheel(LocalFrame& mainFrame, const WebMouseW
heelEvent& event) |
719 { | 719 { |
720 return PageWidgetEventHandler::handleMouseWheel(mainFrame, event); | 720 return PageWidgetEventHandler::handleMouseWheel(mainFrame, event); |
721 } | 721 } |
722 | 722 |
723 bool WebFrameWidgetImpl::handleGestureEvent(const WebGestureEvent& event) | 723 bool WebFrameWidgetImpl::handleGestureEvent(const WebGestureEvent& event) |
724 { | 724 { |
725 // FIXME: Add gesture support. | 725 bool eventSwallowed = false; |
726 return false; | 726 bool eventCancelled = false; |
| 727 switch (event.type) { |
| 728 case WebInputEvent::GestureScrollBegin: |
| 729 case WebInputEvent::GestureScrollEnd: |
| 730 case WebInputEvent::GestureScrollUpdate: |
| 731 case WebInputEvent::GestureTap: |
| 732 case WebInputEvent::GestureTapUnconfirmed: |
| 733 case WebInputEvent::GestureTapDown: |
| 734 case WebInputEvent::GestureShowPress: |
| 735 case WebInputEvent::GestureTapCancel: |
| 736 case WebInputEvent::GestureDoubleTap: |
| 737 case WebInputEvent::GestureTwoFingerTap: |
| 738 case WebInputEvent::GestureLongPress: |
| 739 case WebInputEvent::GestureLongTap: |
| 740 break; |
| 741 case WebInputEvent::GestureFlingStart: |
| 742 case WebInputEvent::GestureFlingCancel: |
| 743 m_client->didHandleGestureEvent(event, eventCancelled); |
| 744 return false; |
| 745 default: |
| 746 ASSERT_NOT_REACHED(); |
| 747 } |
| 748 LocalFrame* frame = m_localRoot->frame(); |
| 749 eventSwallowed = frame->eventHandler().handleGestureEvent(PlatformGestureEve
ntBuilder(frame->view(), event)); |
| 750 m_client->didHandleGestureEvent(event, eventCancelled); |
| 751 return eventSwallowed; |
727 } | 752 } |
728 | 753 |
729 bool WebFrameWidgetImpl::handleKeyEvent(const WebKeyboardEvent& event) | 754 bool WebFrameWidgetImpl::handleKeyEvent(const WebKeyboardEvent& event) |
730 { | 755 { |
731 ASSERT((event.type == WebInputEvent::RawKeyDown) | 756 ASSERT((event.type == WebInputEvent::RawKeyDown) |
732 || (event.type == WebInputEvent::KeyDown) | 757 || (event.type == WebInputEvent::KeyDown) |
733 || (event.type == WebInputEvent::KeyUp)); | 758 || (event.type == WebInputEvent::KeyUp)); |
734 | 759 |
735 // Please refer to the comments explaining the m_suppressNextKeypressEvent | 760 // Please refer to the comments explaining the m_suppressNextKeypressEvent |
736 // member. | 761 // member. |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 // correspond to Page visibility, but is necessary until we properly sort ou
t OOPIF visibility. | 1065 // correspond to Page visibility, but is necessary until we properly sort ou
t OOPIF visibility. |
1041 page()->setVisibilityState(static_cast<PageVisibilityState>(visibilityState)
, isInitialState); | 1066 page()->setVisibilityState(static_cast<PageVisibilityState>(visibilityState)
, isInitialState); |
1042 | 1067 |
1043 if (m_layerTreeView) { | 1068 if (m_layerTreeView) { |
1044 bool visible = visibilityState == WebPageVisibilityStateVisible; | 1069 bool visible = visibilityState == WebPageVisibilityStateVisible; |
1045 m_layerTreeView->setVisible(visible); | 1070 m_layerTreeView->setVisible(visible); |
1046 } | 1071 } |
1047 } | 1072 } |
1048 | 1073 |
1049 } // namespace blink | 1074 } // namespace blink |
OLD | NEW |