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/WebViewImpl.cpp

Issue 288423002: WebView: speed up user gesture notification for GestureTap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Check for the presence of the autofill agent + avoid duplicated 1st user gesture reports Created 6 years, 7 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1820 bool WebViewImpl::hasVerticalScrollbar() 1820 bool WebViewImpl::hasVerticalScrollbar()
1821 { 1821 {
1822 return mainFrameImpl()->frameView()->verticalScrollbar(); 1822 return mainFrameImpl()->frameView()->verticalScrollbar();
1823 } 1823 }
1824 1824
1825 const WebInputEvent* WebViewImpl::m_currentInputEvent = 0; 1825 const WebInputEvent* WebViewImpl::m_currentInputEvent = 0;
1826 1826
1827 bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) 1827 bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
1828 { 1828 {
1829 UserGestureNotifier notifier(m_autofillClient, &m_userGestureObserved); 1829 UserGestureNotifier notifier(m_autofillClient, &m_userGestureObserved);
1830 // On the first input event since page load, |notifier| instructs the
1831 // autofill client to unblock values of password input fields of any forms
1832 // on the page. There is a single input event, GestureTap, which can both
1833 // be the first event after page load, and cause a form submission. In that
1834 // case, the form submission happens before the autofill client is told
1835 // to unblock the password values, and so the password values are not
1836 // submitted. To avoid that, GestureTap is handled explicitly:
1837 if (inputEvent.type == WebInputEvent::GestureTap && m_autofillClient) {
1838 m_userGestureObserved = true;
1839 m_autofillClient->firstUserGestureObserved();
1840 }
1830 1841
1831 TRACE_EVENT0("input", "WebViewImpl::handleInputEvent"); 1842 TRACE_EVENT0("input", "WebViewImpl::handleInputEvent");
1832 // If we've started a drag and drop operation, ignore input events until 1843 // If we've started a drag and drop operation, ignore input events until
1833 // we're done. 1844 // we're done.
1834 if (m_doingDragAndDrop) 1845 if (m_doingDragAndDrop)
1835 return true; 1846 return true;
1836 1847
1837 if (m_devToolsAgent && m_devToolsAgent->handleInputEvent(m_page.get(), input Event)) 1848 if (m_devToolsAgent && m_devToolsAgent->handleInputEvent(m_page.get(), input Event))
1838 return true; 1849 return true;
1839 1850
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after
4064 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4075 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4065 4076
4066 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4077 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4067 return false; 4078 return false;
4068 4079
4069 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4080 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4070 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4081 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4071 } 4082 }
4072 4083
4073 } // namespace blink 4084 } // 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