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_input_context_client.h" | 5 #include "chromeos/dbus/ibus/ibus_input_context_client.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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 base::Bind(&IBusInputContextClientImpl::OnSignalConnected, | 344 base::Bind(&IBusInputContextClientImpl::OnSignalConnected, |
345 weak_ptr_factory_.GetWeakPtr())); | 345 weak_ptr_factory_.GetWeakPtr())); |
346 | 346 |
347 proxy_->ConnectToSignal( | 347 proxy_->ConnectToSignal( |
348 ibus::input_context::kServiceInterface, | 348 ibus::input_context::kServiceInterface, |
349 ibus::input_context::kHidePreeditTextSignal, | 349 ibus::input_context::kHidePreeditTextSignal, |
350 base::Bind(&IBusInputContextClientImpl::OnHidePreeditText, | 350 base::Bind(&IBusInputContextClientImpl::OnHidePreeditText, |
351 weak_ptr_factory_.GetWeakPtr()), | 351 weak_ptr_factory_.GetWeakPtr()), |
352 base::Bind(&IBusInputContextClientImpl::OnSignalConnected, | 352 base::Bind(&IBusInputContextClientImpl::OnSignalConnected, |
353 weak_ptr_factory_.GetWeakPtr())); | 353 weak_ptr_factory_.GetWeakPtr())); |
| 354 |
| 355 proxy_->ConnectToSignal( |
| 356 ibus::input_context::kServiceInterface, |
| 357 ibus::input_context::kDeleteSurroundingTextSignal, |
| 358 base::Bind(&IBusInputContextClientImpl::OnDeleteSurroundingText, |
| 359 weak_ptr_factory_.GetWeakPtr()), |
| 360 base::Bind(&IBusInputContextClientImpl::OnSignalConnected, |
| 361 weak_ptr_factory_.GetWeakPtr())); |
354 } | 362 } |
355 | 363 |
356 // Handles the result of signal connection setup. | 364 // Handles the result of signal connection setup. |
357 void OnSignalConnected(const std::string& interface, | 365 void OnSignalConnected(const std::string& interface, |
358 const std::string& signal, | 366 const std::string& signal, |
359 bool succeeded) { | 367 bool succeeded) { |
360 LOG_IF(ERROR, !succeeded) << "Connect to " << interface << " " | 368 LOG_IF(ERROR, !succeeded) << "Connect to " << interface << " " |
361 << signal << " failed."; | 369 << signal << " failed."; |
362 } | 370 } |
363 | 371 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 // static | 508 // static |
501 IBusInputContextClient* IBusInputContextClient::Create( | 509 IBusInputContextClient* IBusInputContextClient::Create( |
502 DBusClientImplementationType type) { | 510 DBusClientImplementationType type) { |
503 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) { | 511 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) { |
504 return new IBusInputContextClientImpl(); | 512 return new IBusInputContextClientImpl(); |
505 } | 513 } |
506 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 514 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
507 return new IBusInputContextClientDaemonlessImpl(); | 515 return new IBusInputContextClientDaemonlessImpl(); |
508 } | 516 } |
509 } // namespace chromeos | 517 } // namespace chromeos |
OLD | NEW |