Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_manager_impl.cc

Issue 10917061: Fix preedit handling on IME switching. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Revise comments Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 http://crbug.com/p/12798
Yusuke Sato 2012/09/04 17:49:53 crosbug please also fix the BUG= line.
Seigo Nonaka 2012/09/04 18:08:48 Opps, thanks. Done. On 2012/09/04 17:49:53, Yusuke
252 // We should notify IME switching to ibus-daemon, otherwise
253 // IBusPreeditFocusMode does not work. To achieve it, change engine to
254 // itself if the next engine is XKB layout.
255 const std::string current_input_method_id = current_input_method_.id();
256 if (current_input_method_id.empty() ||
257 InputMethodUtil::IsKeyboardLayout(current_input_method_id)) {
258 ibus_controller_->Reset();
259 } else {
260 ibus_controller_->ChangeInputMethod(current_input_method_id);
261 }
252 } else { 262 } else {
253 ibus_controller_->ChangeInputMethod(input_method_id_to_switch); 263 ibus_controller_->ChangeInputMethod(input_method_id_to_switch);
254 } 264 }
255 265
256 if (current_input_method_.id() != input_method_id_to_switch) { 266 if (current_input_method_.id() != input_method_id_to_switch) {
257 const InputMethodDescriptor* descriptor = NULL; 267 const InputMethodDescriptor* descriptor = NULL;
258 if (!InputMethodUtil::IsExtensionInputMethod(input_method_id_to_switch)) { 268 if (!InputMethodUtil::IsExtensionInputMethod(input_method_id_to_switch)) {
259 descriptor = 269 descriptor =
260 util_.GetInputMethodDescriptorFromId(input_method_id_to_switch); 270 util_.GetInputMethodDescriptorFromId(input_method_id_to_switch);
261 } else { 271 } else {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 DVLOG(1) << "Failed to initialize the candidate window controller"; 622 DVLOG(1) << "Failed to initialize the candidate window controller";
613 } 623 }
614 624
615 // static 625 // static
616 InputMethodManagerImpl* InputMethodManagerImpl::GetInstanceForTesting() { 626 InputMethodManagerImpl* InputMethodManagerImpl::GetInstanceForTesting() {
617 return new InputMethodManagerImpl; 627 return new InputMethodManagerImpl;
618 } 628 }
619 629
620 } // namespace input_method 630 } // namespace input_method
621 } // namespace chromeos 631 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698