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

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

Issue 419293002: IME refactoring: ChromeOS introduce input methods State. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test fixed. Re-sorted methods of StateImpl and IMM. 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/chromeos/input_method/component_extension_ime_manager_impl.cc
diff --git a/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc b/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc
index 1b2a6eb60b56d52c36e043166273ec541dab102f..876e2682ffdd1026c583ac111e43d856db12830c 100644
--- a/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc
@@ -232,12 +232,7 @@ const struct InputMethodNameMap {
const char kImePathKeyName[] = "ime_path";
-extensions::ComponentLoader* GetComponentLoader() {
- // TODO(skuhne, nkostylev): At this time the only thing which makes sense here
- // is to use the active profile. Nkostylev is working on getting IME settings
- // to work for multi user by collecting all settings from all users. Once that
- // is done we might have to re-visit this decision.
- Profile* profile = ProfileManager::GetActiveUserProfile();
+extensions::ComponentLoader* GetComponentLoader(Profile* profile) {
extensions::ExtensionSystem* extension_system =
extensions::ExtensionSystem::Get(profile);
ExtensionService* extension_service = extension_system->extension_service();
@@ -257,26 +252,27 @@ std::vector<ComponentExtensionIME> ComponentExtensionIMEManagerImpl::ListIME() {
return component_extension_list_;
}
-bool ComponentExtensionIMEManagerImpl::Load(const std::string& extension_id,
+bool ComponentExtensionIMEManagerImpl::Load(Profile* profile,
+ const std::string& extension_id,
const std::string& manifest,
const base::FilePath& file_path) {
- Profile* profile = ProfileManager::GetActiveUserProfile();
extensions::ExtensionSystem* extension_system =
extensions::ExtensionSystem::Get(profile);
ExtensionService* extension_service = extension_system->extension_service();
if (extension_service->GetExtensionById(extension_id, false))
return false;
const std::string loaded_extension_id =
- GetComponentLoader()->Add(manifest, file_path);
+ GetComponentLoader(profile)->Add(manifest, file_path);
DCHECK_EQ(loaded_extension_id, extension_id);
return true;
}
-void ComponentExtensionIMEManagerImpl::Unload(const std::string& extension_id,
+void ComponentExtensionIMEManagerImpl::Unload(Profile* profile,
+ const std::string& extension_id,
const base::FilePath& file_path) {
// Remove(extension_id) does nothing when the extension has already been
// removed or not been registered.
- GetComponentLoader()->Remove(extension_id);
+ GetComponentLoader(profile)->Remove(extension_id);
}
scoped_ptr<base::DictionaryValue> ComponentExtensionIMEManagerImpl::GetManifest(

Powered by Google App Engine
This is Rietveld 408576698