Chromium Code Reviews| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 DVLOG(1) << "Can't change the current input method to " | 241 DVLOG(1) << "Can't change the current input method to " |
| 242 << input_method_id << " since the engine is not enabled. " | 242 << input_method_id << " since the engine is not enabled. " |
| 243 << "Switch to " << input_method_id_to_switch << " instead."; | 243 << "Switch to " << input_method_id_to_switch << " instead."; |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 if (InputMethodUtil::IsKeyboardLayout(input_method_id_to_switch)) { | 247 if (InputMethodUtil::IsKeyboardLayout(input_method_id_to_switch)) { |
| 248 FOR_EACH_OBSERVER(InputMethodManager::Observer, | 248 FOR_EACH_OBSERVER(InputMethodManager::Observer, |
| 249 observers_, | 249 observers_, |
| 250 InputMethodPropertyChanged(this)); | 250 InputMethodPropertyChanged(this)); |
| 251 ibus_controller_->Reset(); | 251 // Hack for fixing |
| 252 // https://code.google.com/p/chrome-os-partner/issues/detail?id=12798 | |
|
Yusuke Sato
2012/09/04 17:28:35
http://crosbug.com/p/12798
Seigo Nonaka
2012/09/04 17:47:34
Done.
| |
| 253 // We should notify ime switching to ibus-daemon, otherwise | |
|
Yusuke Sato
2012/09/04 17:28:35
IME
Seigo Nonaka
2012/09/04 17:47:34
Done.
| |
| 254 // IBusPreeditFocusMode does not work. To achieve it, change engine to | |
| 255 // itself if the next engine is xkb layout. | |
|
Yusuke Sato
2012/09/04 17:28:35
XKB
Seigo Nonaka
2012/09/04 17:47:34
Done.
| |
| 256 const std::string current_input_method_id = current_input_method_.id(); | |
| 257 if (current_input_method_id.empty() || | |
|
Yusuke Sato
2012/09/04 17:28:35
Q. when can |current_input_method_id| be empty?
Seigo Nonaka
2012/09/04 17:47:34
|current_input_method_id| is empty just after logg
| |
| 258 InputMethodUtil::IsKeyboardLayout(current_input_method_id)) { | |
| 259 ibus_controller_->Reset(); | |
| 260 } else { | |
| 261 ibus_controller_->ChangeInputMethod(current_input_method_id); | |
| 262 } | |
| 252 } else { | 263 } else { |
| 253 ibus_controller_->ChangeInputMethod(input_method_id_to_switch); | 264 ibus_controller_->ChangeInputMethod(input_method_id_to_switch); |
| 254 } | 265 } |
| 255 | 266 |
| 256 if (current_input_method_.id() != input_method_id_to_switch) { | 267 if (current_input_method_.id() != input_method_id_to_switch) { |
| 257 const InputMethodDescriptor* descriptor = NULL; | 268 const InputMethodDescriptor* descriptor = NULL; |
| 258 if (!InputMethodUtil::IsExtensionInputMethod(input_method_id_to_switch)) { | 269 if (!InputMethodUtil::IsExtensionInputMethod(input_method_id_to_switch)) { |
| 259 descriptor = | 270 descriptor = |
| 260 util_.GetInputMethodDescriptorFromId(input_method_id_to_switch); | 271 util_.GetInputMethodDescriptorFromId(input_method_id_to_switch); |
| 261 } else { | 272 } else { |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 612 DVLOG(1) << "Failed to initialize the candidate window controller"; | 623 DVLOG(1) << "Failed to initialize the candidate window controller"; |
| 613 } | 624 } |
| 614 | 625 |
| 615 // static | 626 // static |
| 616 InputMethodManagerImpl* InputMethodManagerImpl::GetInstanceForTesting() { | 627 InputMethodManagerImpl* InputMethodManagerImpl::GetInstanceForTesting() { |
| 617 return new InputMethodManagerImpl; | 628 return new InputMethodManagerImpl; |
| 618 } | 629 } |
| 619 | 630 |
| 620 } // namespace input_method | 631 } // namespace input_method |
| 621 } // namespace chromeos | 632 } // namespace chromeos |
| OLD | NEW |