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

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

Issue 333813002: Focus plugin on gesturetapdown. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use gesturetapdown instead Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 return false; 830 return false;
831 float absDelta = delta > 0 ? delta : -delta; 831 float absDelta = delta > 0 ? delta : -delta;
832 return scrollbarGroup->scroll(delta < 0 ? negativeDirection : positiveDirect ion, ScrollByPrecisePixel, absDelta); 832 return scrollbarGroup->scroll(delta < 0 ? negativeDirection : positiveDirect ion, ScrollByPrecisePixel, absDelta);
833 } 833 }
834 834
835 void WebPluginContainerImpl::handleGestureEvent(GestureEvent* event) 835 void WebPluginContainerImpl::handleGestureEvent(GestureEvent* event)
836 { 836 {
837 WebGestureEventBuilder webEvent(this, m_element->renderer(), *event); 837 WebGestureEventBuilder webEvent(this, m_element->renderer(), *event);
838 if (webEvent.type == WebInputEvent::Undefined) 838 if (webEvent.type == WebInputEvent::Undefined)
839 return; 839 return;
840 if (event->type() == EventTypeNames::gesturetapdown)
841 focusPlugin();
840 WebCursorInfo cursorInfo; 842 WebCursorInfo cursorInfo;
841 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) { 843 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) {
842 event->setDefaultHandled(); 844 event->setDefaultHandled();
843 return; 845 return;
844 } 846 }
845 847
846 if (webEvent.type == WebInputEvent::GestureScrollUpdate || webEvent.type == WebInputEvent::GestureScrollUpdateWithoutPropagation) { 848 if (webEvent.type == WebInputEvent::GestureScrollUpdate || webEvent.type == WebInputEvent::GestureScrollUpdateWithoutPropagation) {
847 if (!m_scrollbarGroup) 849 if (!m_scrollbarGroup)
848 return; 850 return;
849 if (gestureScrollHelper(m_scrollbarGroup.get(), ScrollLeft, ScrollRight, webEvent.data.scrollUpdate.deltaX)) 851 if (gestureScrollHelper(m_scrollbarGroup.get(), ScrollLeft, ScrollRight, webEvent.data.scrollUpdate.deltaX))
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 911
910 return clipRect; 912 return clipRect;
911 } 913 }
912 914
913 bool WebPluginContainerImpl::pluginShouldPersist() const 915 bool WebPluginContainerImpl::pluginShouldPersist() const
914 { 916 {
915 return m_webPlugin->shouldPersist(); 917 return m_webPlugin->shouldPersist();
916 } 918 }
917 919
918 } // namespace blink 920 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698