Commit 7899e8da authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

[rulebased] Don't use NativeInputMethodEngine when rulebased flag is off.

As a precaution, use the old InputMethodEngine when rulebased flag is
off so that we return to old behaviour if we had to turn off the flag
due to bugs.

Bug: 1034355
Change-Id: I9a2b5288b0ca4f56d5c9972374720dc2318c3b14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2026547
Commit-Queue: Leo Zhang <googleo@chromium.org>
Reviewed-by: default avatarLeo Zhang <googleo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736161}
parent d6ad5193
......@@ -22,6 +22,7 @@
#include "chrome/browser/ui/ash/keyboard/chrome_keyboard_controller_client.h"
#include "chrome/common/extensions/api/input_ime.h"
#include "chrome/common/extensions/api/input_method_private.h"
#include "chromeos/constants/chromeos_features.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/process_manager.h"
#include "extensions/common/manifest_handlers/background_info.h"
......@@ -462,9 +463,11 @@ bool InputImeEventRouter::RegisterImeExtension(
}
auto observer = std::make_unique<ImeObserverChromeOS>(extension_id, profile);
auto engine = (extension_id == "jkghodnilhceideoidjikpgommlajknk")
? std::make_unique<chromeos::NativeInputMethodEngine>()
: std::make_unique<chromeos::InputMethodEngine>();
auto engine =
(extension_id == "jkghodnilhceideoidjikpgommlajknk" &&
base::FeatureList::IsEnabled(chromeos::features::kNativeRuleBasedTyping))
? std::make_unique<chromeos::NativeInputMethodEngine>()
: std::make_unique<chromeos::InputMethodEngine>();
engine->Initialize(std::move(observer), extension_id.c_str(), profile);
engine_map_[extension_id] = std::move(engine);
......
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