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 "chromeos/dbus/ibus/ibus_engine_factory_service.h" | 5 #include "chromeos/dbus/ibus/ibus_engine_factory_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 virtual ~IBusEngineFactoryServiceImpl() { | 35 virtual ~IBusEngineFactoryServiceImpl() { |
36 bus_->UnregisterExportedObject(dbus::ObjectPath( | 36 bus_->UnregisterExportedObject(dbus::ObjectPath( |
37 ibus::engine_factory::kServicePath)); | 37 ibus::engine_factory::kServicePath)); |
38 } | 38 } |
39 | 39 |
40 // IBusEngineFactoryService override. | 40 // IBusEngineFactoryService override. |
41 virtual void SetCreateEngineHandler( | 41 virtual void SetCreateEngineHandler( |
42 const std::string& engine_id, | 42 const std::string& engine_id, |
43 const CreateEngineHandler& create_engine_handler) OVERRIDE { | 43 const CreateEngineHandler& create_engine_handler) OVERRIDE { |
44 DCHECK(!create_engine_callback_map_[engine_id].is_null()); | 44 DCHECK(create_engine_callback_map_[engine_id].is_null()); |
45 create_engine_callback_map_[engine_id] = create_engine_handler; | 45 create_engine_callback_map_[engine_id] = create_engine_handler; |
46 } | 46 } |
47 | 47 |
48 // IBusEngineFactoryService override. | 48 // IBusEngineFactoryService override. |
49 virtual void UnsetCreateEngineHandler( | 49 virtual void UnsetCreateEngineHandler( |
50 const std::string& engine_id) OVERRIDE { | 50 const std::string& engine_id) OVERRIDE { |
51 create_engine_callback_map_[engine_id].Reset(); | 51 create_engine_callback_map_[engine_id].Reset(); |
52 } | 52 } |
53 | 53 |
54 private: | 54 private: |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 IBusEngineFactoryService* IBusEngineFactoryService::Create( | 132 IBusEngineFactoryService* IBusEngineFactoryService::Create( |
133 dbus::Bus* bus, | 133 dbus::Bus* bus, |
134 DBusClientImplementationType type) { | 134 DBusClientImplementationType type) { |
135 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 135 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
136 return new IBusEngineFactoryServiceImpl(bus); | 136 return new IBusEngineFactoryServiceImpl(bus); |
137 else | 137 else |
138 return new IBusEngineFactoryServiceStubImpl(); | 138 return new IBusEngineFactoryServiceStubImpl(); |
139 } | 139 } |
140 | 140 |
141 } // namespace chromeos | 141 } // namespace chromeos |
OLD | NEW |