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

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager_impl.cc

Issue 428783008: GetActiveUserProfile() should not be called before profile is initialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 6 years, 5 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/chromeos/input_method/input_method_manager_impl.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index 8db20e0df9a396ec26bb20e81aab5b8a57aeb807..bc87740a236710894ac22cb1315f6fa3e4e60649 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -433,6 +433,7 @@ void InputMethodManagerImpl::ActivateInputMethodMenuItem(
}
void InputMethodManagerImpl::AddInputMethodExtension(
+ Profile* profile,
const std::string& id,
InputMethodEngineInterface* engine) {
if (state_ == STATE_TERMINATING)
@@ -440,7 +441,7 @@ void InputMethodManagerImpl::AddInputMethodExtension(
DCHECK(engine);
- profile_engine_map_[GetProfile()][id] = engine;
+ profile_engine_map_[profile][id] = engine;
if (id == current_input_method_.id()) {
IMEBridge::Get()->SetCurrentEngineHandler(engine);
@@ -469,7 +470,8 @@ void InputMethodManagerImpl::AddInputMethodExtension(
}
}
-void InputMethodManagerImpl::RemoveInputMethodExtension(const std::string& id) {
+void InputMethodManagerImpl::RemoveInputMethodExtension(Profile* profile,
+ const std::string& id) {
if (!extension_ime_util::IsExtensionIME(id))
DVLOG(1) << id << " is not a valid extension input method ID.";
@@ -479,7 +481,7 @@ void InputMethodManagerImpl::RemoveInputMethodExtension(const std::string& id) {
active_input_method_ids_.erase(i);
extra_input_methods_.erase(id);
- EngineMap& engine_map = profile_engine_map_[GetProfile()];
+ EngineMap& engine_map = profile_engine_map_[profile];
if (IMEBridge::Get()->GetCurrentEngineHandler() == engine_map[id])
IMEBridge::Get()->SetCurrentEngineHandler(NULL);
engine_map.erase(id);

Powered by Google App Engine
This is Rietveld 408576698