diff options
author | shuchen@chromium.org <shuchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-11 11:30:45 +0000 |
---|---|---|
committer | shuchen@chromium.org <shuchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-11 11:30:45 +0000 |
commit | dd9e3673c168c9ed98daa020113f52f4489dabce (patch) | |
tree | 550c0b27f0ea11cee21ba200d762efdec871f0d0 /chromeos | |
parent | 5e75b7a0a2dc13f19e77647bb2decbedcdd1df57 (diff) | |
download | chromium_src-dd9e3673c168c9ed98daa020113f52f4489dabce.zip chromium_src-dd9e3673c168c9ed98daa020113f52f4489dabce.tar.gz chromium_src-dd9e3673c168c9ed98daa020113f52f4489dabce.tar.bz2 |
[IME] Use ExtensionSystem to check extension's availability instead of holding an internal set in ComponentExtensionIMEManagerImpl. This is to fix the problem of xkb extension doesn't expose its resource to chrome-extension://... The root cause of the problem is that ComponentExtensionIMEManagerImpl object is created before login, but ExtensionSystem is initialized after login. Therefore, xkb extension which is loaded before login won't be in ExtensionSystem but ComponentExtensionIMEManagerImpl thinks it's already been loaded.
BUG=351200
TEST=Verified on pixel device.
Review URL: https://codereview.chromium.org/194183003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
4 files changed, 6 insertions, 8 deletions
diff --git a/chromeos/ime/component_extension_ime_manager.cc b/chromeos/ime/component_extension_ime_manager.cc index e33ce3e..e39537a 100644 --- a/chromeos/ime/component_extension_ime_manager.cc +++ b/chromeos/ime/component_extension_ime_manager.cc @@ -116,10 +116,10 @@ bool ComponentExtensionIMEManager::LoadComponentExtensionIME( bool ComponentExtensionIMEManager::UnloadComponentExtensionIME( const std::string& input_method_id) { ComponentExtensionIME ime; - if (FindEngineEntry(input_method_id, &ime, NULL)) - return delegate_->Unload(ime.id, ime.path); - else + if (!FindEngineEntry(input_method_id, &ime, NULL)) return false; + delegate_->Unload(ime.id, ime.path); + return true; } bool ComponentExtensionIMEManager::IsWhitelisted( diff --git a/chromeos/ime/component_extension_ime_manager.h b/chromeos/ime/component_extension_ime_manager.h index fad81d3..bc26ec6 100644 --- a/chromeos/ime/component_extension_ime_manager.h +++ b/chromeos/ime/component_extension_ime_manager.h @@ -55,8 +55,7 @@ class CHROMEOS_EXPORT ComponentExtensionIMEManagerDelegate { const base::FilePath& path) = 0; // Unloads component extension IME associated with |extension_id|. - // Returns false if it fails, otherwise returns true; - virtual bool Unload(const std::string& extension_id, + virtual void Unload(const std::string& extension_id, const base::FilePath& path) = 0; }; diff --git a/chromeos/ime/mock_component_extension_ime_manager_delegate.cc b/chromeos/ime/mock_component_extension_ime_manager_delegate.cc index ee075af..4ffbf72 100644 --- a/chromeos/ime/mock_component_extension_ime_manager_delegate.cc +++ b/chromeos/ime/mock_component_extension_ime_manager_delegate.cc @@ -31,11 +31,10 @@ bool MockComponentExtIMEManagerDelegate::Load(const std::string& extension_id, return true; } -bool MockComponentExtIMEManagerDelegate::Unload(const std::string& extension_id, +void MockComponentExtIMEManagerDelegate::Unload(const std::string& extension_id, const base::FilePath& path) { unload_call_count_++; last_unloaded_extension_id_ = extension_id; - return false; } } // namespace input_method diff --git a/chromeos/ime/mock_component_extension_ime_manager_delegate.h b/chromeos/ime/mock_component_extension_ime_manager_delegate.h index 0442697..49f8e1f 100644 --- a/chromeos/ime/mock_component_extension_ime_manager_delegate.h +++ b/chromeos/ime/mock_component_extension_ime_manager_delegate.h @@ -21,7 +21,7 @@ class CHROMEOS_EXPORT MockComponentExtIMEManagerDelegate virtual bool Load(const std::string& extension_id, const std::string& manifest, const base::FilePath& path) OVERRIDE; - virtual bool Unload(const std::string& extension_id, + virtual void Unload(const std::string& extension_id, const base::FilePath& path) OVERRIDE; int load_call_count() const { return load_call_count_; } |