| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> // std::find | 7 #include <algorithm> // std::find |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 DVLOG(1) << "Can't change the current input method to " | 235 DVLOG(1) << "Can't change the current input method to " |
| 236 << input_method_id << " since the engine is not enabled. " | 236 << input_method_id << " since the engine is not enabled. " |
| 237 << "Switch to " << input_method_id_to_switch << " instead."; | 237 << "Switch to " << input_method_id_to_switch << " instead."; |
| 238 } | 238 } |
| 239 } | 239 } |
| 240 | 240 |
| 241 if (InputMethodUtil::IsKeyboardLayout(input_method_id_to_switch)) { | 241 if (InputMethodUtil::IsKeyboardLayout(input_method_id_to_switch)) { |
| 242 FOR_EACH_OBSERVER(InputMethodManager::Observer, | 242 FOR_EACH_OBSERVER(InputMethodManager::Observer, |
| 243 observers_, | 243 observers_, |
| 244 InputMethodPropertyChanged(this)); | 244 InputMethodPropertyChanged(this)); |
| 245 ibus_controller_->Reset(); |
| 245 } else { | 246 } else { |
| 246 ibus_controller_->ChangeInputMethod(input_method_id_to_switch); | 247 ibus_controller_->ChangeInputMethod(input_method_id_to_switch); |
| 247 } | 248 } |
| 248 | 249 |
| 249 if (current_input_method_.id() != input_method_id_to_switch) { | 250 if (current_input_method_.id() != input_method_id_to_switch) { |
| 250 const InputMethodDescriptor* descriptor = NULL; | 251 const InputMethodDescriptor* descriptor = NULL; |
| 251 if (!InputMethodUtil::IsExtensionInputMethod(input_method_id_to_switch)) { | 252 if (!InputMethodUtil::IsExtensionInputMethod(input_method_id_to_switch)) { |
| 252 descriptor = | 253 descriptor = |
| 253 util_.GetInputMethodDescriptorFromId(input_method_id_to_switch); | 254 util_.GetInputMethodDescriptorFromId(input_method_id_to_switch); |
| 254 } else { | 255 } else { |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 #endif | 594 #endif |
| 594 } | 595 } |
| 595 | 596 |
| 596 // static | 597 // static |
| 597 InputMethodManagerImpl* InputMethodManagerImpl::GetInstanceForTesting() { | 598 InputMethodManagerImpl* InputMethodManagerImpl::GetInstanceForTesting() { |
| 598 return new InputMethodManagerImpl; | 599 return new InputMethodManagerImpl; |
| 599 } | 600 } |
| 600 | 601 |
| 601 } // namespace input_method | 602 } // namespace input_method |
| 602 } // namespace chromeos | 603 } // namespace chromeos |
| OLD | NEW |