| 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_engine_ibus.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_engine_ibus.h" |
| 6 | 6 |
| 7 #define XK_MISCELLANY | 7 #define XK_MISCELLANY |
| 8 #include <X11/keysymdef.h> | 8 #include <X11/keysymdef.h> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 std::string layout; | 95 std::string layout; |
| 96 if (!layouts.empty()) { | 96 if (!layouts.empty()) { |
| 97 layout = JoinString(layouts, ','); | 97 layout = JoinString(layouts, ','); |
| 98 } else { | 98 } else { |
| 99 const std::string fallback_id = | 99 const std::string fallback_id = |
| 100 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); | 100 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); |
| 101 const input_method::InputMethodDescriptor* fallback_desc = | 101 const input_method::InputMethodDescriptor* fallback_desc = |
| 102 manager->GetInputMethodUtil()->GetInputMethodDescriptorFromId( | 102 manager->GetInputMethodUtil()->GetInputMethodDescriptorFromId( |
| 103 fallback_id); | 103 fallback_id); |
| 104 layout = fallback_desc->keyboard_layout(); | 104 layout = fallback_desc->GetPreferredKeyboardLayout(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 component_.reset(new IBusComponent()); | 107 component_.reset(new IBusComponent()); |
| 108 component_->set_name(std::string(kEngineBusPrefix) + std::string(engine_id)); | 108 component_->set_name(std::string(kEngineBusPrefix) + std::string(engine_id)); |
| 109 component_->set_description(description); | 109 component_->set_description(description); |
| 110 component_->set_author(engine_name); | 110 component_->set_author(engine_name); |
| 111 | 111 |
| 112 chromeos::IBusComponent::EngineDescription engine_desc; | 112 chromeos::IBusComponent::EngineDescription engine_desc; |
| 113 engine_desc.engine_id = ibus_id_; | 113 engine_desc.engine_id = ibus_id_; |
| 114 engine_desc.display_name = description; | 114 engine_desc.display_name = description; |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 DBusThreadManager::Get()->RemoveIBusEngineService(object_path_); | 616 DBusThreadManager::Get()->RemoveIBusEngineService(object_path_); |
| 617 | 617 |
| 618 current_object_path_++; | 618 current_object_path_++; |
| 619 object_path_ = dbus::ObjectPath(kObjectPathPrefix + | 619 object_path_ = dbus::ObjectPath(kObjectPathPrefix + |
| 620 base::IntToString(current_object_path_)); | 620 base::IntToString(current_object_path_)); |
| 621 GetCurrentService()->SetEngine(this); | 621 GetCurrentService()->SetEngine(this); |
| 622 sender.Run(object_path_); | 622 sender.Run(object_path_); |
| 623 } | 623 } |
| 624 | 624 |
| 625 } // namespace chromeos | 625 } // namespace chromeos |
| OLD | NEW |