| 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_client.h" | 5 #include "chromeos/dbus/ibus/ibus_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "chromeos/dbus/ibus/ibus_constants.h" | |
| 10 #include "dbus/bus.h" | 9 #include "dbus/bus.h" |
| 11 #include "dbus/message.h" | 10 #include "dbus/message.h" |
| 12 #include "dbus/object_path.h" | 11 #include "dbus/object_path.h" |
| 13 #include "dbus/object_proxy.h" | 12 #include "dbus/object_proxy.h" |
| 14 | 13 |
| 15 namespace chromeos { | 14 namespace chromeos { |
| 16 | 15 |
| 17 namespace { | 16 namespace { |
| 18 | 17 |
| 18 const char kIBusServiceName[] = "org.freedesktop.IBus"; |
| 19 const char kIBusServicePath[] = "/org/freedesktop/IBus"; |
| 20 const char kIBusServiceInterface[] = "org.freedesktop.IBus"; |
| 21 |
| 22 const char kIBusBusCreateInputContextMethod[] = "CreateInputContext"; |
| 23 |
| 19 // The IBusClient implementation. | 24 // The IBusClient implementation. |
| 20 class IBusClientImpl : public IBusClient { | 25 class IBusClientImpl : public IBusClient { |
| 21 public: | 26 public: |
| 22 explicit IBusClientImpl(dbus::Bus* bus) | 27 explicit IBusClientImpl(dbus::Bus* bus) |
| 23 : proxy_(bus->GetObjectProxy(kIBusServiceName, | 28 : proxy_(bus->GetObjectProxy(kIBusServiceName, |
| 24 dbus::ObjectPath(kIBusServicePath))), | 29 dbus::ObjectPath(kIBusServicePath))), |
| 25 weak_ptr_factory_(this) { | 30 weak_ptr_factory_(this) { |
| 26 } | 31 } |
| 27 | 32 |
| 28 virtual ~IBusClientImpl() {} | 33 virtual ~IBusClientImpl() {} |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 IBusClient* IBusClient::Create(DBusClientImplementationType type, | 116 IBusClient* IBusClient::Create(DBusClientImplementationType type, |
| 112 dbus::Bus* bus) { | 117 dbus::Bus* bus) { |
| 113 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) { | 118 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) { |
| 114 return new IBusClientImpl(bus); | 119 return new IBusClientImpl(bus); |
| 115 } | 120 } |
| 116 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 121 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
| 117 return new IBusClientStubImpl(); | 122 return new IBusClientStubImpl(); |
| 118 } | 123 } |
| 119 | 124 |
| 120 } // namespace chromeos | 125 } // namespace chromeos |
| OLD | NEW |