summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authoryoichio@chromium.org <yoichio@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-30 04:46:54 +0000
committeryoichio@chromium.org <yoichio@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-30 04:46:54 +0000
commitead34f6e320ea87e845f4e9b7825c181bb283d1f (patch)
treea0e450839115e18cfad911f0bb3e45907a805144 /chromeos
parent1ccb699d0f1cf0b36fd045e7f2fbc93490b4fe9e (diff)
downloadchromium_src-ead34f6e320ea87e845f4e9b7825c181bb283d1f.zip
chromium_src-ead34f6e320ea87e845f4e9b7825c181bb283d1f.tar.gz
chromium_src-ead34f6e320ea87e845f4e9b7825c181bb283d1f.tar.bz2
Set focused TextInputType to InputMethodEndingeIBus.
This doesn't change actual behavior. BUG=311514 Review URL: https://codereview.chromium.org/43433003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/ime/ibus_bridge.h2
-rw-r--r--chromeos/ime/ime_constants.h23
-rw-r--r--chromeos/ime/mock_ime_engine_handler.cc4
-rw-r--r--chromeos/ime/mock_ime_engine_handler.h7
4 files changed, 33 insertions, 3 deletions
diff --git a/chromeos/ime/ibus_bridge.h b/chromeos/ime/ibus_bridge.h
index a537e94..57799ec 100644
--- a/chromeos/ime/ibus_bridge.h
+++ b/chromeos/ime/ibus_bridge.h
@@ -60,7 +60,7 @@ class CHROMEOS_EXPORT IBusEngineHandlerInterface {
virtual ~IBusEngineHandlerInterface() {}
// Called when the Chrome input field get the focus.
- virtual void FocusIn() = 0;
+ virtual void FocusIn(ibus::TextInputType text_input_type) = 0;
// Called when the Chrome input field lose the focus.
virtual void FocusOut() = 0;
diff --git a/chromeos/ime/ime_constants.h b/chromeos/ime/ime_constants.h
index 8dcfffa..5f32601 100644
--- a/chromeos/ime/ime_constants.h
+++ b/chromeos/ime/ime_constants.h
@@ -39,6 +39,29 @@ struct Rect {
int height;
};
+// We can't use ui/base/ime/text_input_type.h in chromeos/, so we should
+// redefine that.
+enum TextInputType {
+ TEXT_INPUT_TYPE_NONE,
+ TEXT_INPUT_TYPE_TEXT,
+ TEXT_INPUT_TYPE_PASSWORD,
+ TEXT_INPUT_TYPE_SEARCH,
+ TEXT_INPUT_TYPE_EMAIL,
+ TEXT_INPUT_TYPE_NUMBER,
+ TEXT_INPUT_TYPE_TELEPHONE,
+ TEXT_INPUT_TYPE_URL,
+ TEXT_INPUT_TYPE_DATE,
+ TEXT_INPUT_TYPE_DATE_TIME,
+ TEXT_INPUT_TYPE_DATE_TIME_LOCAL,
+ TEXT_INPUT_TYPE_MONTH,
+ TEXT_INPUT_TYPE_TIME,
+ TEXT_INPUT_TYPE_WEEK,
+ TEXT_INPUT_TYPE_TEXT_AREA,
+ TEXT_INPUT_TYPE_CONTENT_EDITABLE,
+ TEXT_INPUT_TYPE_DATE_TIME_FIELD,
+ TEXT_INPUT_TYPE_MAX = TEXT_INPUT_TYPE_DATE_TIME_FIELD,
+};
+
} // namespace ibus
} // namespace chromeos
diff --git a/chromeos/ime/mock_ime_engine_handler.cc b/chromeos/ime/mock_ime_engine_handler.cc
index bedd18e..d708971 100644
--- a/chromeos/ime/mock_ime_engine_handler.cc
+++ b/chromeos/ime/mock_ime_engine_handler.cc
@@ -12,6 +12,7 @@ MockIMEEngineHandler::MockIMEEngineHandler()
set_surrounding_text_call_count_(0),
process_key_event_call_count_(0),
reset_call_count_(0),
+ last_text_input_type_(ibus::TEXT_INPUT_TYPE_NONE),
last_set_surrounding_cursor_pos_(0),
last_set_surrounding_anchor_pos_(0),
last_processed_keysym_(0),
@@ -22,8 +23,9 @@ MockIMEEngineHandler::MockIMEEngineHandler()
MockIMEEngineHandler::~MockIMEEngineHandler() {
}
-void MockIMEEngineHandler::FocusIn() {
+void MockIMEEngineHandler::FocusIn(ibus::TextInputType text_input_type) {
++focus_in_call_count_;
+ last_text_input_type_ = text_input_type;
}
void MockIMEEngineHandler::FocusOut() {
diff --git a/chromeos/ime/mock_ime_engine_handler.h b/chromeos/ime/mock_ime_engine_handler.h
index d8f39d9..2f9e3ee 100644
--- a/chromeos/ime/mock_ime_engine_handler.h
+++ b/chromeos/ime/mock_ime_engine_handler.h
@@ -14,7 +14,7 @@ class MockIMEEngineHandler : public IBusEngineHandlerInterface {
MockIMEEngineHandler();
virtual ~MockIMEEngineHandler();
- virtual void FocusIn() OVERRIDE;
+ virtual void FocusIn(ibus::TextInputType text_input_type) OVERRIDE;
virtual void FocusOut() OVERRIDE;
virtual void Enable() OVERRIDE;
virtual void Disable() OVERRIDE;
@@ -40,6 +40,10 @@ class MockIMEEngineHandler : public IBusEngineHandlerInterface {
return process_key_event_call_count_;
}
+ ibus::TextInputType last_text_input_type() const {
+ return last_text_input_type_;
+ }
+
std::string last_set_surrounding_text() const {
return last_set_surrounding_text_;
}
@@ -74,6 +78,7 @@ class MockIMEEngineHandler : public IBusEngineHandlerInterface {
int set_surrounding_text_call_count_;
int process_key_event_call_count_;
int reset_call_count_;
+ ibus::TextInputType last_text_input_type_;
std::string last_set_surrounding_text_;
uint32 last_set_surrounding_cursor_pos_;
uint32 last_set_surrounding_anchor_pos_;