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

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

Issue 1313763004: Support gesture events in WebFrameWidgetImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update Created 5 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
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | Source/web/tests/WebFrameTest.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 const LocalFrame* frame = m_localRoot->frame();
dcheng 2015/08/31 16:51:20 Nit: const here looks weird: handling a gesture ev
Peng 2015/08/31 17:34:57 Done.
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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 // correspond to Page visibility, but is necessary until we properly sort ou t OOPIF visibility. 1075 // correspond to Page visibility, but is necessary until we properly sort ou t OOPIF visibility.
1051 page()->setVisibilityState(static_cast<PageVisibilityState>(visibilityState) , isInitialState); 1076 page()->setVisibilityState(static_cast<PageVisibilityState>(visibilityState) , isInitialState);
1052 1077
1053 if (m_layerTreeView) { 1078 if (m_layerTreeView) {
1054 bool visible = visibilityState == WebPageVisibilityStateVisible; 1079 bool visible = visibilityState == WebPageVisibilityStateVisible;
1055 m_layerTreeView->setVisible(visible); 1080 m_layerTreeView->setVisible(visible);
1056 } 1081 }
1057 } 1082 }
1058 1083
1059 } // namespace blink 1084 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | Source/web/tests/WebFrameTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698