Chromium Code Reviews| Index: Source/web/WebViewImpl.cpp |
| diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
| index a0bd095a749a7bec78814557274cc5ca80085d98..2c2e07d5c39a09741a707223ab6b72ac00551af4 100644 |
| --- a/Source/web/WebViewImpl.cpp |
| +++ b/Source/web/WebViewImpl.cpp |
| @@ -389,7 +389,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) |
| , m_ignoreInputEvents(false) |
| , m_compositorDeviceScaleFactorOverride(0) |
| , m_rootLayerScale(1) |
| - , m_suppressNextKeypressEvent(false) |
| + , m_suppressNextKeypressEvent(Suppress_None) |
| , m_imeAcceptEvents(true) |
| , m_operationsAllowed(WebDragOperationNone) |
| , m_dragOperation(WebDragOperationNone) |
| @@ -993,9 +993,9 @@ bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) |
| // member. |
| // The m_suppressNextKeypressEvent is set if the KeyDown is handled by |
| // Webkit. A keyDown event is typically associated with a keyPress(char) |
| - // event and a keyUp event. We reset this flag here as this is a new keyDown |
| + // event and a keyUp event. We reset this state here as this is a new keyDown |
| // event. |
| - m_suppressNextKeypressEvent = false; |
| + m_suppressNextKeypressEvent = Suppress_None; |
| // If there is a select popup, it should be the one processing the event, |
| // not the page. |
| @@ -1006,7 +1006,7 @@ bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) |
| // We need to ignore the next Char event after this otherwise pressing |
| // enter when selecting an item in the popup will go to the page. |
| if (WebInputEvent::RawKeyDown == event.type) |
| - m_suppressNextKeypressEvent = true; |
| + m_suppressNextKeypressEvent = Suppress_KeyEventCancelled; |
| return true; |
| } |
| @@ -1030,7 +1030,7 @@ bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) |
| // (Flash needs these keypress events to handle non-US keyboards.) |
| Element* element = focusedElement(); |
| if (!element || !element->renderer() || !element->renderer()->isEmbeddedObject()) |
| - m_suppressNextKeypressEvent = true; |
| + m_suppressNextKeypressEvent = Suppress_KeyEventCancelled; // FIXME: Adding this bug on purpose for testing. |
| } |
| return true; |
| } |
| @@ -1063,8 +1063,8 @@ bool WebViewImpl::handleCharEvent(const WebKeyboardEvent& event) |
| // handled by Webkit. A keyDown event is typically associated with a |
| // keyPress(char) event and a keyUp event. We reset this flag here as it |
| // only applies to the current keyPress event. |
| - bool suppress = m_suppressNextKeypressEvent; |
| - m_suppressNextKeypressEvent = false; |
| + bool suppress = (m_suppressNextKeypressEvent != Suppress_None); |
| + m_suppressNextKeypressEvent = Suppress_None; |
| // If there is a select popup, it should be the one processing the event, |
| // not the page. |
| @@ -2270,7 +2270,7 @@ bool WebViewImpl::setComposition( |
| // If we're not going to fire a keypress event, then the keydown event was |
| // canceled. In that case, cancel any existing composition. |
| - if (text.isEmpty() || m_suppressNextKeypressEvent) { |
| + if (text.isEmpty() || m_suppressNextKeypressEvent == Suppress_KeyEventCancelled) { |
|
James Su
2015/02/26 09:16:59
1. Looks like Suppress_KeyEventHandled is not used
|
| // A browser process sent an IPC message which does not contain a valid |
| // string, which means an ongoing composition has been canceled. |
| // If the ongoing composition has been canceled, replace the ongoing |