Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_DELEGATE_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_DELEGATE_H_ |
| 6 #define CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_DELEGATE_H_ | 6 #define CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/common/input/input_event_ack.h" | 11 #include "content/common/input/input_event_ack.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 class WebGestureEvent; | 14 class WebGestureEvent; |
| 15 class WebMouseEvent; | 15 class WebMouseEvent; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class Point; | 19 class Point; |
| 20 class Vector2dF; | 20 class Vector2dF; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 | 24 |
| 25 class RenderWidgetInputHandler; | 25 class RenderWidgetInputHandler; |
| 26 | 26 |
| 27 enum class ShowIme { IF_NEEDED, HIDE_IME }; | 27 enum class ShowIme { IF_NEEDED, DO_NOT_SHOW }; |
|
aelias_OOO_until_Jul13
2017/01/04 20:11:01
I think I'd prefer the following naming:
enum cla
Changwan Ryu
2017/01/05 08:47:03
I agree that virtual keyboard is much clearer than
| |
| 28 | |
| 29 enum class ChangeSource { | |
| 30 FROM_NON_IME, | |
| 31 FROM_IME, | |
| 32 }; | |
| 33 | 28 |
| 34 // Consumers of RenderWidgetInputHandler implement this delegate in order to | 29 // Consumers of RenderWidgetInputHandler implement this delegate in order to |
| 35 // transport input handling information across processes. | 30 // transport input handling information across processes. |
| 36 class CONTENT_EXPORT RenderWidgetInputHandlerDelegate { | 31 class CONTENT_EXPORT RenderWidgetInputHandlerDelegate { |
| 37 public: | 32 public: |
| 38 // Called when animations due to focus change have completed (if any). | 33 // Called when animations due to focus change have completed (if any). |
| 39 virtual void FocusChangeComplete() = 0; | 34 virtual void FocusChangeComplete() = 0; |
| 40 | 35 |
| 41 // Check whether the WebWidget has any touch event handlers registered | 36 // Check whether the WebWidget has any touch event handlers registered |
| 42 // at the given point. | 37 // at the given point. |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 63 // (DISPATCH_TYPE_*_NOTIFY_MAIN) of |handled_type| has been processed | 58 // (DISPATCH_TYPE_*_NOTIFY_MAIN) of |handled_type| has been processed |
| 64 // by the main thread. | 59 // by the main thread. |
| 65 virtual void NotifyInputEventHandled(blink::WebInputEvent::Type handled_type, | 60 virtual void NotifyInputEventHandled(blink::WebInputEvent::Type handled_type, |
| 66 InputEventAckState ack_result) = 0; | 61 InputEventAckState ack_result) = 0; |
| 67 | 62 |
| 68 // Notifies the delegate of the |input_handler| managing it. | 63 // Notifies the delegate of the |input_handler| managing it. |
| 69 virtual void SetInputHandler(RenderWidgetInputHandler* input_handler) = 0; | 64 virtual void SetInputHandler(RenderWidgetInputHandler* input_handler) = 0; |
| 70 | 65 |
| 71 // |show_ime| should be ShowIme::IF_NEEDED iff the update may cause the ime to | 66 // |show_ime| should be ShowIme::IF_NEEDED iff the update may cause the ime to |
| 72 // be displayed, e.g. after a tap on an input field on mobile. | 67 // be displayed, e.g. after a tap on an input field on mobile. |
| 73 // |change_source| should be ChangeSource::FROM_NON_IME when the renderer has | 68 virtual void UpdateTextInputState(ShowIme show_ime) = 0; |
| 74 // to wait for the browser to acknowledge the change before the renderer | |
| 75 // handles any more IME events. This is when the text change did not originate | |
| 76 // from the IME in the browser side, such as changes by JavaScript or | |
| 77 // autofill. | |
| 78 virtual void UpdateTextInputState(ShowIme show_ime, | |
| 79 ChangeSource change_source) = 0; | |
| 80 | 69 |
| 81 // Notifies that a gesture event is about to be handled. | 70 // Notifies that a gesture event is about to be handled. |
| 82 // Returns true if no further handling is needed. In that case, the event | 71 // Returns true if no further handling is needed. In that case, the event |
| 83 // won't be sent to WebKit. | 72 // won't be sent to WebKit. |
| 84 virtual bool WillHandleGestureEvent(const blink::WebGestureEvent& event) = 0; | 73 virtual bool WillHandleGestureEvent(const blink::WebGestureEvent& event) = 0; |
| 85 | 74 |
| 86 // Notifies that a mouse event is about to be handled. | 75 // Notifies that a mouse event is about to be handled. |
| 87 // Returns true if no further handling is needed. In that case, the event | 76 // Returns true if no further handling is needed. In that case, the event |
| 88 // won't be sent to WebKit or trigger DidHandleMouseEvent(). | 77 // won't be sent to WebKit or trigger DidHandleMouseEvent(). |
| 89 virtual bool WillHandleMouseEvent(const blink::WebMouseEvent& event) = 0; | 78 virtual bool WillHandleMouseEvent(const blink::WebMouseEvent& event) = 0; |
| 90 | 79 |
| 91 protected: | 80 protected: |
| 92 virtual ~RenderWidgetInputHandlerDelegate() {} | 81 virtual ~RenderWidgetInputHandlerDelegate() {} |
| 93 }; | 82 }; |
| 94 | 83 |
| 95 } // namespace content | 84 } // namespace content |
| 96 | 85 |
| 97 #endif // CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_DELEGATE_H_ | 86 #endif // CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_DELEGATE_H_ |
| OLD | NEW |