Commit 026a3e67 authored by yusukes's avatar yusukes Committed by Commit Bot

Use the fake language for ARC IMEs

With this, such IMEs will be excluded from the available IME list
for English.

BUG=b:74499980
TEST=unit_tests

Change-Id: Ied09c0c787bf54527229133a1d792cabbc4aac7c
Reviewed-on: https://chromium-review.googlesource.com/1113206Reviewed-by: default avatarYuichiro Hanada <yhanada@chromium.org>
Commit-Queue: Yusuke Sato <yusukes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569992}
parent ab90b51c
...@@ -209,10 +209,15 @@ void ArcInputMethodManagerService::SwitchImeTo(const std::string& ime_id) { ...@@ -209,10 +209,15 @@ void ArcInputMethodManagerService::SwitchImeTo(const std::string& ime_id) {
chromeos::input_method::InputMethodDescriptor chromeos::input_method::InputMethodDescriptor
ArcInputMethodManagerService::BuildInputMethodDescriptor( ArcInputMethodManagerService::BuildInputMethodDescriptor(
const mojom::ImeInfo* info) { const mojom::ImeInfo* info) {
// TODO(yhanada): Set the special layout/language value for ARC IMEs after // We don't care too much about |layouts| at this point since the feature is
// making settings and IME menu tray support it. // for tablet mode.
std::vector<std::string> layouts{"us"}; const std::vector<std::string> layouts{"us"};
std::vector<std::string> languages{"en-US"};
// Set the fake language so that the IME is shown in the special section in
// chrome://settings.
const std::vector<std::string> languages{
chromeos::extension_ime_util::kArcImeLanguage};
const std::string display_name = info->display_name; const std::string display_name = info->display_name;
const std::string& input_method_id = const std::string& input_method_id =
......
...@@ -320,6 +320,9 @@ TEST_F(ArcInputMethodManagerServiceTest, OnImeInfoChanged) { ...@@ -320,6 +320,9 @@ TEST_F(ArcInputMethodManagerServiceTest, OnImeInfoChanged) {
EXPECT_EQ(android_ime_id1, GetComponentIDByInputMethodID( EXPECT_EQ(android_ime_id1, GetComponentIDByInputMethodID(
std::get<1>(added_extensions[0])[0].id())); std::get<1>(added_extensions[0])[0].id()));
EXPECT_EQ(display_name1, std::get<1>(added_extensions[0])[0].name()); EXPECT_EQ(display_name1, std::get<1>(added_extensions[0])[0].name());
ASSERT_EQ(1u, std::get<1>(added_extensions[0])[0].language_codes().size());
EXPECT_TRUE(chromeos::extension_ime_util::IsLanguageForArcIME(
(std::get<1>(added_extensions[0])[0].language_codes())[0]));
// Emulate enabling ARC IME from chrome://settings. // Emulate enabling ARC IME from chrome://settings.
const std::string& arc_ime_id = std::get<1>(added_extensions[0])[0].id(); const std::string& arc_ime_id = std::get<1>(added_extensions[0])[0].id();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment