Commit bab98785 authored by zork@chromium.org's avatar zork@chromium.org

Disable extension IMEs when the screen is locked


R=yusukes@chromium.org
BUG=chromium-os:27049
TEST=See bug


Review URL: http://codereview.chromium.org/9809016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128903 0039d316-1c4b-4281-b951-d872f2087c98
parent 8a87c0dc
...@@ -80,6 +80,7 @@ class InputMethodManagerImpl : public InputMethodManager, ...@@ -80,6 +80,7 @@ class InputMethodManagerImpl : public InputMethodManager,
should_launch_ime_(false), should_launch_ime_(false),
ime_connected_(false), ime_connected_(false),
enable_auto_ime_shutdown_(false), // workaround for crosbug.com/27051. enable_auto_ime_shutdown_(false), // workaround for crosbug.com/27051.
enable_extension_imes_(true),
shutting_down_(false), shutting_down_(false),
ibus_daemon_process_handle_(base::kNullProcessHandle), ibus_daemon_process_handle_(base::kNullProcessHandle),
util_(whitelist_.GetSupportedInputMethods()), util_(whitelist_.GetSupportedInputMethods()),
...@@ -308,10 +309,12 @@ class InputMethodManagerImpl : public InputMethodManager, ...@@ -308,10 +309,12 @@ class InputMethodManagerImpl : public InputMethodManager,
value.type == InputMethodConfigValue::kValueTypeStringList) { value.type == InputMethodConfigValue::kValueTypeStringList) {
active_input_method_ids_ = value.string_list_value; active_input_method_ids_ = value.string_list_value;
std::map<std::string, InputMethodDescriptor>::const_iterator ix; if (enable_extension_imes_) {
for (ix = extra_input_method_ids_.begin(); std::map<std::string, InputMethodDescriptor>::const_iterator ix;
ix != extra_input_method_ids_.end(); ++ix) { for (ix = extra_input_method_ids_.begin();
active_input_method_ids_.push_back(ix->first); ix != extra_input_method_ids_.end(); ++ix) {
active_input_method_ids_.push_back(ix->first);
}
} }
} }
...@@ -1192,6 +1195,10 @@ class InputMethodManagerImpl : public InputMethodManager, ...@@ -1192,6 +1195,10 @@ class InputMethodManagerImpl : public InputMethodManager,
// enable_auto_ime_shutdown_ = enable; // enable_auto_ime_shutdown_ = enable;
} }
void SetEnableExtensionIMEs(bool enable) {
enable_extension_imes_ = enable;
}
// content::NotificationObserver implementation: // content::NotificationObserver implementation:
void Observe(int type, void Observe(int type,
const content::NotificationSource& source, const content::NotificationSource& source,
...@@ -1252,6 +1259,8 @@ class InputMethodManagerImpl : public InputMethodManager, ...@@ -1252,6 +1259,8 @@ class InputMethodManagerImpl : public InputMethodManager,
// True if we should stop input method daemon when there are no input // True if we should stop input method daemon when there are no input
// methods other than one for the hardware keyboard. // methods other than one for the hardware keyboard.
bool enable_auto_ime_shutdown_; bool enable_auto_ime_shutdown_;
// True if extension IMEs can be enabled.
bool enable_extension_imes_;
// The ID of the tentative current input method (ex. "mozc"). This value // The ID of the tentative current input method (ex. "mozc"). This value
// can be different from the actual current input method, if // can be different from the actual current input method, if
// ChangeInputMethod() fails. // ChangeInputMethod() fails.
......
...@@ -216,6 +216,10 @@ class InputMethodManager { ...@@ -216,6 +216,10 @@ class InputMethodManager {
// engines are removed. // engines are removed.
virtual void SetEnableAutoImeShutdown(bool enable) = 0; virtual void SetEnableAutoImeShutdown(bool enable) = 0;
// Controls whether extension IME are displayed in the language menu, and can
// be selected.
virtual void SetEnableExtensionIMEs(bool enable) = 0;
// Sends a handwriting stroke to libcros. See chromeos::SendHandwritingStroke // Sends a handwriting stroke to libcros. See chromeos::SendHandwritingStroke
// for details. // for details.
virtual void SendHandwritingStroke( virtual void SendHandwritingStroke(
......
...@@ -161,6 +161,7 @@ class ScreenLockObserver : public chromeos::PowerManagerClient::Observer, ...@@ -161,6 +161,7 @@ class ScreenLockObserver : public chromeos::PowerManagerClient::Observer,
// We don't want to shut down the IME, even if the hardware layout is the // We don't want to shut down the IME, even if the hardware layout is the
// only IME left. // only IME left.
manager->SetEnableAutoImeShutdown(false); manager->SetEnableAutoImeShutdown(false);
manager->SetEnableExtensionIMEs(false);
manager->SetInputMethodConfig( manager->SetInputMethodConfig(
chromeos::language_prefs::kGeneralSectionName, chromeos::language_prefs::kGeneralSectionName,
chromeos::language_prefs::kPreloadEnginesConfigName, chromeos::language_prefs::kPreloadEnginesConfigName,
...@@ -178,6 +179,7 @@ class ScreenLockObserver : public chromeos::PowerManagerClient::Observer, ...@@ -178,6 +179,7 @@ class ScreenLockObserver : public chromeos::PowerManagerClient::Observer,
chromeos::input_method::InputMethodConfigValue::kValueTypeStringList; chromeos::input_method::InputMethodConfigValue::kValueTypeStringList;
value.string_list_value = saved_active_input_method_list_; value.string_list_value = saved_active_input_method_list_;
manager->SetEnableAutoImeShutdown(true); manager->SetEnableAutoImeShutdown(true);
manager->SetEnableExtensionIMEs(true);
manager->SetInputMethodConfig( manager->SetInputMethodConfig(
chromeos::language_prefs::kGeneralSectionName, chromeos::language_prefs::kGeneralSectionName,
chromeos::language_prefs::kPreloadEnginesConfigName, chromeos::language_prefs::kPreloadEnginesConfigName,
......
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