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

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

Issue 2393043004: Blimp: IME should submit form with text (Closed)
Patch Set: dtrainor@ comments 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
« no previous file with comments | « blimp/client/core/contents/ime_feature.h ('k') | blimp/client/core/contents/ime_feature_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/core/contents/ime_feature.cc
diff --git a/blimp/client/core/contents/ime_feature.cc b/blimp/client/core/contents/ime_feature.cc
index 4a4bcdbfe331165cdd44125d5d47c0e95aab0ac9..d22cdf93852f3bf819af19770f8af15e2d6b5e12 100644
--- a/blimp/client/core/contents/ime_feature.cc
+++ b/blimp/client/core/contents/ime_feature.cc
@@ -14,13 +14,20 @@
namespace blimp {
namespace client {
-ImeFeature::ImeFeature() {}
+ImeFeature::WebInputRequest::WebInputRequest()
+ : input_type(ui::TEXT_INPUT_TYPE_NONE) {}
+
+ImeFeature::WebInputRequest::~WebInputRequest() = default;
+
+ImeFeature::WebInputResponse::WebInputResponse() : submit(false) {}
+
+ImeFeature::ImeFeature() : weak_factory_(this) {}
ImeFeature::~ImeFeature() {}
void ImeFeature::OnImeTextEntered(int tab_id,
int render_widget_id,
- const std::string& text) {
+ const WebInputResponse& response) {
DCHECK_LE(0, tab_id);
DCHECK_LT(0, render_widget_id);
@@ -29,7 +36,8 @@ void ImeFeature::OnImeTextEntered(int tab_id,
CreateBlimpMessage(&ime_message, tab_id);
ime_message->set_render_widget_id(render_widget_id);
ime_message->set_type(ImeMessage::SET_TEXT);
- ime_message->set_ime_text(text);
+ ime_message->set_ime_text(response.text);
+ ime_message->set_auto_submit(response.submit);
outgoing_message_processor_->ProcessMessage(std::move(blimp_message),
net::CompletionCallback());
@@ -52,13 +60,15 @@ void ImeFeature::ProcessMessage(std::unique_ptr<BlimpMessage> message,
return;
}
{
- ShowImeCallback show_ime_callback = base::Bind(
- &ImeFeature::OnImeTextEntered, base::Unretained(this),
+ WebInputRequest request;
+ request.input_type = InputMessageConverter::TextInputTypeFromProto(
+ ime_message.text_input_type());
+ request.text = ime_message.ime_text();
+ request.show_ime_callback = base::Bind(
+ &ImeFeature::OnImeTextEntered, weak_factory_.GetWeakPtr(),
message->target_tab_id(), ime_message.render_widget_id());
- delegate_->OnShowImeRequested(
- InputMessageConverter::TextInputTypeFromProto(
- ime_message.text_input_type()),
- ime_message.ime_text(), show_ime_callback);
+
+ delegate_->OnShowImeRequested(request);
}
break;
case ImeMessage::HIDE_IME:
« no previous file with comments | « blimp/client/core/contents/ime_feature.h ('k') | blimp/client/core/contents/ime_feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698