| 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_panel_service.h" | 5 #include "chromeos/dbus/ibus/ibus_panel_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "chromeos/dbus/ibus/ibus_constants.h" | 10 #include "chromeos/dbus/ibus/ibus_constants.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 ibus::panel::kServiceInterface, | 117 ibus::panel::kServiceInterface, |
| 118 ibus::panel::kStateChangedMethod, | 118 ibus::panel::kStateChangedMethod, |
| 119 base::Bind(&IBusPanelServiceImpl::NoOperation, | 119 base::Bind(&IBusPanelServiceImpl::NoOperation, |
| 120 weak_ptr_factory_.GetWeakPtr()), | 120 weak_ptr_factory_.GetWeakPtr()), |
| 121 base::Bind(&IBusPanelServiceImpl::OnMethodExported, | 121 base::Bind(&IBusPanelServiceImpl::OnMethodExported, |
| 122 weak_ptr_factory_.GetWeakPtr())); | 122 weak_ptr_factory_.GetWeakPtr())); |
| 123 | 123 |
| 124 // Request well known name to ibus-daemon. | 124 // Request well known name to ibus-daemon. |
| 125 bus->RequestOwnership( | 125 bus->RequestOwnership( |
| 126 ibus::panel::kServiceName, | 126 ibus::panel::kServiceName, |
| 127 dbus::Bus::REQUIRE_PRIMARY, |
| 127 base::Bind(&IBusPanelServiceImpl::OnRequestOwnership, | 128 base::Bind(&IBusPanelServiceImpl::OnRequestOwnership, |
| 128 weak_ptr_factory_.GetWeakPtr())); | 129 weak_ptr_factory_.GetWeakPtr())); |
| 129 | 130 |
| 130 input_context->SetSetCursorLocationHandler( | 131 input_context->SetSetCursorLocationHandler( |
| 131 base::Bind(&IBusPanelServiceImpl::SetCursorLocation, | 132 base::Bind(&IBusPanelServiceImpl::SetCursorLocation, |
| 132 weak_ptr_factory_.GetWeakPtr())); | 133 weak_ptr_factory_.GetWeakPtr())); |
| 133 } | 134 } |
| 134 | 135 |
| 135 virtual ~IBusPanelServiceImpl() { | 136 virtual ~IBusPanelServiceImpl() { |
| 136 bus_->UnregisterExportedObject( | 137 bus_->UnregisterExportedObject( |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 dbus::Bus* bus, | 448 dbus::Bus* bus, |
| 448 IBusInputContextClient* input_context) { | 449 IBusInputContextClient* input_context) { |
| 449 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) { | 450 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) { |
| 450 return new IBusPanelServiceImpl(bus, input_context); | 451 return new IBusPanelServiceImpl(bus, input_context); |
| 451 } else { | 452 } else { |
| 452 return new IBusPanelServiceDaemonlessImpl(); | 453 return new IBusPanelServiceDaemonlessImpl(); |
| 453 } | 454 } |
| 454 } | 455 } |
| 455 | 456 |
| 456 } // namespace chromeos | 457 } // namespace chromeos |
| OLD | NEW |