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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2250233002: Type->String helper function added to WebInputEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Blink_Common_export instead of blink_export Created 4 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
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 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 WebConsoleMessage consoleMessage(WebConsoleMessage::LevelWarning, message); 1060 WebConsoleMessage consoleMessage(WebConsoleMessage::LevelWarning, message);
1061 mainFrame()->addMessageToConsole(consoleMessage); 1061 mainFrame()->addMessageToConsole(consoleMessage);
1062 } 1062 }
1063 1063
1064 WebInputEventResult WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) 1064 WebInputEventResult WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
1065 { 1065 {
1066 DCHECK((event.type == WebInputEvent::RawKeyDown) 1066 DCHECK((event.type == WebInputEvent::RawKeyDown)
1067 || (event.type == WebInputEvent::KeyDown) 1067 || (event.type == WebInputEvent::KeyDown)
1068 || (event.type == WebInputEvent::KeyUp)); 1068 || (event.type == WebInputEvent::KeyUp));
1069 TRACE_EVENT2("input", "WebViewImpl::handleKeyEvent", 1069 TRACE_EVENT2("input", "WebViewImpl::handleKeyEvent",
1070 "type", inputTypeToName(event.type), 1070 "type", WebInputEvent::GetName(event.type),
1071 "text", String(event.text).utf8()); 1071 "text", String(event.text).utf8());
1072 1072
1073 // Halt an in-progress fling on a key event. 1073 // Halt an in-progress fling on a key event.
1074 endActiveFlingAnimation(); 1074 endActiveFlingAnimation();
1075 1075
1076 // Please refer to the comments explaining the m_suppressNextKeypressEvent 1076 // Please refer to the comments explaining the m_suppressNextKeypressEvent
1077 // member. 1077 // member.
1078 // The m_suppressNextKeypressEvent is set if the KeyDown is handled by 1078 // The m_suppressNextKeypressEvent is set if the KeyDown is handled by
1079 // Webkit. A keyDown event is typically associated with a keyPress(char) 1079 // Webkit. A keyDown event is typically associated with a keyPress(char)
1080 // event and a keyUp event. We reset this flag here as this is a new keyDown 1080 // event and a keyUp event. We reset this flag here as this is a new keyDown
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 // case, the form submission happens before the autofill client is told 2140 // case, the form submission happens before the autofill client is told
2141 // to unblock the password values, and so the password values are not 2141 // to unblock the password values, and so the password values are not
2142 // submitted. To avoid that, GestureTap is handled explicitly: 2142 // submitted. To avoid that, GestureTap is handled explicitly:
2143 if (inputEvent.type == WebInputEvent::GestureTap && autofillClient) { 2143 if (inputEvent.type == WebInputEvent::GestureTap && autofillClient) {
2144 m_userGestureObserved = true; 2144 m_userGestureObserved = true;
2145 autofillClient->firstUserGestureObserved(); 2145 autofillClient->firstUserGestureObserved();
2146 } 2146 }
2147 2147
2148 page()->frameHost().visualViewport().startTrackingPinchStats(); 2148 page()->frameHost().visualViewport().startTrackingPinchStats();
2149 2149
2150 TRACE_EVENT1("input,rail", "WebViewImpl::handleInputEvent", "type", inputTyp eToName(inputEvent.type)); 2150 TRACE_EVENT1("input,rail", "WebViewImpl::handleInputEvent", "type", WebInput Event::GetName(inputEvent.type));
2151 // If we've started a drag and drop operation, ignore input events until 2151 // If we've started a drag and drop operation, ignore input events until
2152 // we're done. 2152 // we're done.
2153 if (m_doingDragAndDrop) 2153 if (m_doingDragAndDrop)
2154 return WebInputEventResult::HandledSuppressed; 2154 return WebInputEventResult::HandledSuppressed;
2155 2155
2156 if (m_devToolsEmulator->handleInputEvent(inputEvent)) 2156 if (m_devToolsEmulator->handleInputEvent(inputEvent))
2157 return WebInputEventResult::HandledSuppressed; 2157 return WebInputEventResult::HandledSuppressed;
2158 2158
2159 if (InspectorOverlay* overlay = inspectorOverlay()) { 2159 if (InspectorOverlay* overlay = inspectorOverlay()) {
2160 if (overlay->handleInputEvent(inputEvent)) 2160 if (overlay->handleInputEvent(inputEvent))
(...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after
4600 return nullptr; 4600 return nullptr;
4601 return focusedFrame; 4601 return focusedFrame;
4602 } 4602 }
4603 4603
4604 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const 4604 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const
4605 { 4605 {
4606 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4606 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4607 } 4607 }
4608 4608
4609 } // namespace blink 4609 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698