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

Unified Diff: blimp/client/core/contents/ime_feature.h

Issue 2393043004: Blimp: IME should submit form with text (Closed)
Patch Set: Added unit tests and browser test Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
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..48757ed22b69b82368eaa0293dc702e4a6453b3d 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:
+ struct WebInputResponse;
+
// A callback to show IME.
- using ShowImeCallback = base::Callback<void(const std::string&)>;
+ using ShowImeCallback = base::Callback<void(const WebInputResponse&)>;
+
+ // A bundle of params required by the client.
+ struct WebInputRequest {
+ WebInputRequest();
+ ~WebInputRequest();
+
+ ui::TextInputType input_type;
+ std::string text;
+ ShowImeCallback show_ime_callback;
+ };
+
+ // A bundle of params to be sent to the engine.
+ struct WebInputResponse {
+ WebInputResponse();
+ ~WebInputResponse() = default;
+
+ 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;
};
@@ -63,7 +82,7 @@ class ImeFeature : public BlimpMessageProcessor {
// Sends text from IME to the blimp engine.
void OnImeTextEntered(int tab_id,
int render_widget_id,
- const std::string& text);
+ const WebInputResponse& response);
// Used to actually show or hide the IME. See notes on |set_delegate|.
Delegate* delegate_ = nullptr;

Powered by Google App Engine
This is Rietveld 408576698