summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos/input_method/input_method_manager_impl.cc')
-rw-r--r--chrome/browser/chromeos/input_method/input_method_manager_impl.cc49
1 files changed, 16 insertions, 33 deletions
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 3432e7b..8fda319 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -6,6 +6,8 @@
#include <algorithm> // std::find
+#include "ash/ime/input_method_menu_item.h"
+#include "ash/ime/input_method_menu_manager.h"
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/location.h"
@@ -357,8 +359,11 @@ bool InputMethodManagerImpl::ChangeInputMethodInternal(
// extension IMEs via InputMethodEngine::(Set|Update)MenuItems.
// If the current input method is a keyboard layout, empty
// properties are sufficient.
- const InputMethodPropertyList empty_property_list;
- SetCurrentInputMethodProperties(empty_property_list);
+ const ash::ime::InputMethodMenuItemList empty_menu_item_list;
+ ash::ime::InputMethodMenuManager* input_method_menu_manager =
+ ash::ime::InputMethodMenuManager::GetInstance();
+ input_method_menu_manager->SetCurrentInputMethodMenuItemList(
+ empty_menu_item_list);
const InputMethodDescriptor* descriptor = NULL;
if (extension_ime_util::IsExtensionIME(input_method_id_to_switch)) {
@@ -426,21 +431,20 @@ void InputMethodManagerImpl::LoadNecessaryComponentExtensions() {
}
}
-void InputMethodManagerImpl::ActivateInputMethodProperty(
+void InputMethodManagerImpl::ActivateInputMethodMenuItem(
const std::string& key) {
DCHECK(!key.empty());
- for (size_t i = 0; i < property_list_.size(); ++i) {
- if (property_list_[i].key == key) {
- IMEEngineHandlerInterface* engine =
- IMEBridge::Get()->GetCurrentEngineHandler();
- if (engine)
- engine->PropertyActivate(key);
- return;
- }
+ if (ash::ime::InputMethodMenuManager::GetInstance()->
+ HasInputMethodMenuItemForKey(key)) {
+ IMEEngineHandlerInterface* engine =
+ IMEBridge::Get()->GetCurrentEngineHandler();
+ if (engine)
+ engine->PropertyActivate(key);
+ return;
}
- DVLOG(1) << "ActivateInputMethodProperty: unknown key: " << key;
+ DVLOG(1) << "ActivateInputMethodMenuItem: unknown key: " << key;
}
void InputMethodManagerImpl::AddInputMethodExtension(
@@ -696,21 +700,6 @@ InputMethodDescriptor InputMethodManagerImpl::GetCurrentInputMethod() const {
return current_input_method_;
}
-InputMethodPropertyList
-InputMethodManagerImpl::GetCurrentInputMethodProperties() const {
- // This check is necessary since an IME property (e.g. for Pinyin) might be
- // sent from ibus-daemon AFTER the current input method is switched to XKB.
- if (InputMethodUtil::IsKeyboardLayout(GetCurrentInputMethod().id()))
- return InputMethodPropertyList(); // Empty list.
- return property_list_;
-}
-
-void InputMethodManagerImpl::SetCurrentInputMethodProperties(
- const InputMethodPropertyList& property_list) {
- property_list_ = property_list;
- PropertyChanged();
-}
-
XKeyboard* InputMethodManagerImpl::GetXKeyboard() {
return xkeyboard_.get();
}
@@ -766,12 +755,6 @@ void InputMethodManagerImpl::InitializeComponentExtensionForTesting(
OnComponentExtensionInitialized(delegate.Pass());
}
-void InputMethodManagerImpl::PropertyChanged() {
- FOR_EACH_OBSERVER(InputMethodManager::Observer,
- observers_,
- InputMethodPropertyChanged(this));
-}
-
void InputMethodManagerImpl::CandidateClicked(int index) {
IMEEngineHandlerInterface* engine =
IMEBridge::Get()->GetCurrentEngineHandler();