| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/cros/input_method_library.h" | 5 #include "chrome/browser/chromeos/cros/input_method_library.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include <glib.h> | 9 #include <glib.h> |
| 10 | 10 |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 | 579 |
| 580 InputMethodLibraryImpl* input_method_library = | 580 InputMethodLibraryImpl* input_method_library = |
| 581 static_cast<InputMethodLibraryImpl*>(object); | 581 static_cast<InputMethodLibraryImpl*>(object); |
| 582 input_method_library->ime_connected_ = connected; | 582 input_method_library->ime_connected_ = connected; |
| 583 if (connected) { | 583 if (connected) { |
| 584 input_method_library->pending_config_requests_.clear(); | 584 input_method_library->pending_config_requests_.clear(); |
| 585 input_method_library->pending_config_requests_.insert( | 585 input_method_library->pending_config_requests_.insert( |
| 586 input_method_library->current_config_values_.begin(), | 586 input_method_library->current_config_values_.begin(), |
| 587 input_method_library->current_config_values_.end()); | 587 input_method_library->current_config_values_.end()); |
| 588 input_method_library->FlushImeConfig(); | 588 input_method_library->FlushImeConfig(); |
| 589 |
| 590 input_method_library->ChangeInputMethod( |
| 591 input_method_library->previous_input_method().id); |
| 592 input_method_library->ChangeInputMethod( |
| 593 input_method_library->current_input_method().id); |
| 589 } | 594 } |
| 590 } | 595 } |
| 591 | 596 |
| 592 // Changes the current input method from the given input method | 597 // Changes the current input method from the given input method |
| 593 // descriptor. This function updates states like current_input_method_ | 598 // descriptor. This function updates states like current_input_method_ |
| 594 // and notifies observers about the change (that will update the | 599 // and notifies observers about the change (that will update the |
| 595 // preferences), hence this function should always be used even if you | 600 // preferences), hence this function should always be used even if you |
| 596 // just need to change the current keyboard layout. | 601 // just need to change the current keyboard layout. |
| 597 void ChangeCurrentInputMethod(const InputMethodDescriptor& new_input_method) { | 602 void ChangeCurrentInputMethod(const InputMethodDescriptor& new_input_method) { |
| 598 if (current_input_method_.id != new_input_method.id) { | 603 if (current_input_method_.id != new_input_method.id) { |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 } | 1199 } |
| 1195 return impl; | 1200 return impl; |
| 1196 } | 1201 } |
| 1197 } | 1202 } |
| 1198 | 1203 |
| 1199 } // namespace chromeos | 1204 } // namespace chromeos |
| 1200 | 1205 |
| 1201 // Allows InvokeLater without adding refcounting. This class is a Singleton and | 1206 // Allows InvokeLater without adding refcounting. This class is a Singleton and |
| 1202 // won't be deleted until it's last InvokeLater is run. | 1207 // won't be deleted until it's last InvokeLater is run. |
| 1203 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::InputMethodLibraryImpl); | 1208 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::InputMethodLibraryImpl); |
| OLD | NEW |