Chromium Code Reviews| Index: content/renderer/render_widget.h |
| diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h |
| index 4f20cc60140334eda7fd819193c368bb4b76af10..26dc7cc1886d512d1d3de05a97dc24bea6355409 100644 |
| --- a/content/renderer/render_widget.h |
| +++ b/content/renderer/render_widget.h |
| @@ -204,6 +204,11 @@ class CONTENT_EXPORT RenderWidget |
| SHOW_IME_IF_NEEDED |
| }; |
| + enum ImeAck { |
| + SEND_IME_ACK, |
| + NO_IME_ACK |
|
jam
2013/07/31 20:57:09
i realize this is the convention in blink, but in
nyquist
2013/08/01 23:11:04
Done.
|
| + }; |
| + |
| // Handle common setup/teardown for handling IME events. |
| void StartHandlingImeEvent(); |
| void FinishHandlingImeEvent(); |
| @@ -326,7 +331,19 @@ class CONTENT_EXPORT RenderWidget |
| #if defined(OS_ANDROID) |
| void OnImeBatchStateChanged(bool is_begin); |
| void OnShowImeIfNeeded(); |
| + |
| + // Whenever an IME event that needs an acknowledgement is sent to the browser, |
| + // the number of outstanding IME events that needs acknowledgement should be |
| + // incremented. All IME events will be dropped until we receive an ack from |
| + // the browser. |
| + void IncrementOutstandingImeEventAcks(); |
| + |
| + // Called by the browser process for every required IME acknowledgement. |
| + void OnImeEventAck(); |
| #endif |
| + // Returns whether we currently should handle an IME event. |
| + bool ShouldHandleImeEvent(); |
| + |
| void OnSnapshot(const gfx::Rect& src_subrect); |
| void OnSetBrowserRenderingStats(const BrowserRenderingStats& stats); |
| @@ -408,7 +425,7 @@ class CONTENT_EXPORT RenderWidget |
| #if defined(OS_ANDROID) |
| // |show_ime_if_needed| should be SHOW_IME_IF_NEEDED iff the update may cause |
| // the ime to be displayed, e.g. after a tap on an input field on mobile. |
| - void UpdateTextInputState(ShowIme show_ime); |
| + void UpdateTextInputState(ShowIme show_ime, ImeAck ack); |
| #endif |
| // Checks if the selection bounds have been changed. If they are changed, |
| @@ -717,6 +734,13 @@ class CONTENT_EXPORT RenderWidget |
| uint32 next_output_surface_id_; |
| +#if defined(OS_ANDROID) |
| + // A counter for number of outstanding messages from the renderer to the |
| + // browser regarding IME-type events that have not been acknowledged by the |
| + // browser. If this value is not 0 IME events will be dropped. |
| + int outstanding_ime_acks_; |
| +#endif |
| + |
| base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(RenderWidget); |