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

Unified Diff: blimp/client/app/android/web_input_box.h

Issue 1779673003: Added network components for blimp text input feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed initial values for tab id in ImeFeature Created 4 years, 9 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/app/android/web_input_box.h
diff --git a/blimp/client/app/android/web_input_box.h b/blimp/client/app/android/web_input_box.h
index 4166b1a40a3c5c35de5964f6811205edfcaed27e..991dee19974f331fe05754b0aa6925d3c5dea1b7 100644
--- a/blimp/client/app/android/web_input_box.h
+++ b/blimp/client/app/android/web_input_box.h
@@ -9,19 +9,27 @@
#include "base/android/jni_android.h"
#include "base/macros.h"
+#include "blimp/client/feature/ime_feature.h"
+#include "ui/base/ime/text_input_type.h"
namespace blimp {
namespace client {
// The native component of org.chromium.blimp.input.WebInputBox.
-class WebInputBox {
+class WebInputBox : public ImeFeature::ImeFeatureDelegate {
public:
static bool RegisterJni(JNIEnv* env);
- WebInputBox(JNIEnv* env, const base::android::JavaParamRef<jobject>& jobj);
+ WebInputBox(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jobj,
+ ImeFeature* ime_feature);
- // Brings up or hides the IME for user to enter text.
- void OnImeRequested(bool show);
+ // Brings up IME for user to enter text.
+ void OnShowImeRequested(ui::TextInputType input_type,
+ const std::string& text) override;
+
+ // Hides IME.
+ void OnHideImeRequested() override;
// Methods called from Java via JNI.
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& jobj);
@@ -37,6 +45,12 @@ class WebInputBox {
// Reference to the Java object which owns this class.
base::android::ScopedJavaGlobalRef<jobject> java_obj_;
+ // A bridge to the network layer which does the work of (de)serializing the
+ // outgoing and incoming BlimpMessage::IME messages from the engine. Life time
+ // of |ime_feature_| is managed by the BlimpClientSession which is expected to
+ // outlive the WebInputBox.
Wez 2016/03/22 21:43:38 nit: Lifetime comment belongs w/ the constructor,
shaktisahu 2016/03/22 23:45:42 Hmm.. I would prefer to keep it here, since it pro
Wez 2016/03/23 00:10:53 I disagree; the point at which constraints need to
+ ImeFeature* ime_feature_;
+
DISALLOW_COPY_AND_ASSIGN(WebInputBox);
};

Powered by Google App Engine
This is Rietveld 408576698