Chromium Code Reviews| Index: blimp/client/core/contents/ime_feature.h |
| diff --git a/blimp/client/core/contents/ime_feature.h b/blimp/client/core/contents/ime_feature.h |
| index c8ff6a473116a032029f9e1e8f4db679ea5487c3..bf8efda407231ffcf49e020bac16b03bb88fc5ad 100644 |
| --- a/blimp/client/core/contents/ime_feature.h |
| +++ b/blimp/client/core/contents/ime_feature.h |
| @@ -27,16 +27,35 @@ namespace client { |
| class ImeFeature : public BlimpMessageProcessor { |
| public: |
| - // A callback to show IME. |
| - using ShowImeCallback = base::Callback<void(const std::string&)>; |
| + // A bundle of params required by the client. |
| + struct WebInputRequest { |
| + WebInputRequest(); |
| + ~WebInputRequest() = default; |
| + |
| + int tab_id; |
| + int render_widget_id; |
| + ui::TextInputType input_type; |
| + std::string text; |
| + ImeFeature* feature; |
|
David Trainor- moved to gerrit
2016/10/14 16:57:40
I'd add callback members for this instead. We mig
shaktisahu
2016/10/14 18:08:18
Done.
|
| + }; |
| + |
| + // A bundle of params to be sent to the engine. |
| + struct WebInputResponse { |
| + WebInputResponse(); |
| + explicit WebInputResponse(const WebInputRequest& request); |
| + ~WebInputResponse() = default; |
| + |
| + int tab_id; |
| + int render_widget_id; |
| + std::string text; |
| + bool submit; |
| + }; |
| // A delegate to be notified of text input requests. |
| class Delegate { |
| public: |
| virtual ~Delegate() {} |
| - virtual void OnShowImeRequested(ui::TextInputType input_type, |
| - const std::string& text, |
| - const ShowImeCallback& callback) = 0; |
| + virtual void OnShowImeRequested(const WebInputRequest& request) = 0; |
| virtual void OnHideImeRequested() = 0; |
| }; |
| @@ -59,12 +78,10 @@ class ImeFeature : public BlimpMessageProcessor { |
| void ProcessMessage(std::unique_ptr<BlimpMessage> message, |
| const net::CompletionCallback& callback) override; |
| - private: |
| // Sends text from IME to the blimp engine. |
| - void OnImeTextEntered(int tab_id, |
| - int render_widget_id, |
| - const std::string& text); |
| + void OnImeTextEntered(const WebInputResponse& response); |
| + private: |
| // Used to actually show or hide the IME. See notes on |set_delegate|. |
| Delegate* delegate_ = nullptr; |