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

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api.cc

Issue 419293002: IME refactoring: ChromeOS introduce input methods State. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 6 years, 4 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: chrome/browser/extensions/api/input_ime/input_ime_api.cc
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.cc b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
index a7b0fdfcf80fc8fb411755cda32399944ed0ddcf..963999ae3dedb839f22925ced215aa495f42c77c 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api.cc
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
@@ -310,7 +310,8 @@ class ImeObserver : public InputMethodEngineInterface::Observer {
// lock screen, login screen, etc.) so that its on-screen keyboard page
// won't open new windows/pages. See crbug.com/395621.
std::string GetCurrentScreenType() {
- switch (chromeos::input_method::InputMethodManager::Get()->GetState()) {
+ switch (chromeos::input_method::InputMethodManager::Get()
+ ->GetUISessionState()) {
case chromeos::input_method::InputMethodManager::STATE_LOGIN_SCREEN:
return "login";
case chromeos::input_method::InputMethodManager::STATE_LOCK_SCREEN:
@@ -388,7 +389,8 @@ bool InputImeEventRouter::RegisterImeExtension(
chromeos::InputMethodEngine* engine = new chromeos::InputMethodEngine();
engine->Initialize(observer.Pass(), extension_id.c_str());
engine_map_[extension_id] = engine;
- manager->AddInputMethodExtension(extension_id, descriptors, engine);
+ manager->GetActiveIMEState()->AddInputMethodExtension(
+ extension_id, descriptors, engine);
return true;
}
@@ -398,6 +400,7 @@ void InputImeEventRouter::UnregisterAllImes(const std::string& extension_id) {
engine_map_.find(extension_id);
if (it != engine_map_.end()) {
chromeos::input_method::InputMethodManager::Get()
+ ->GetActiveIMEState()
->RemoveInputMethodExtension(extension_id);
delete it->second;
engine_map_.erase(it);

Powered by Google App Engine
This is Rietveld 408576698