| 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/cros/sms_watcher.h" | 5 #include "chrome/browser/chromeos/cros/sms_watcher.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 dbus::ObjectPath(modem_device_path), | 368 dbus::ObjectPath(modem_device_path), |
| 369 base::Bind(&SMSWatcher::DevicePropertiesCallback, | 369 base::Bind(&SMSWatcher::DevicePropertiesCallback, |
| 370 weak_ptr_factory_.GetWeakPtr())); | 370 weak_ptr_factory_.GetWeakPtr())); |
| 371 } | 371 } |
| 372 | 372 |
| 373 SMSWatcher::~SMSWatcher() { | 373 SMSWatcher::~SMSWatcher() { |
| 374 } | 374 } |
| 375 | 375 |
| 376 void SMSWatcher::DevicePropertiesCallback( | 376 void SMSWatcher::DevicePropertiesCallback( |
| 377 DBusMethodCallStatus call_status, | 377 DBusMethodCallStatus call_status, |
| 378 const base::DictionaryValue& properties) { | 378 scoped_ptr<base::DictionaryValue> properties) { |
| 379 if (call_status != DBUS_METHOD_CALL_SUCCESS) | 379 if (call_status != DBUS_METHOD_CALL_SUCCESS) |
| 380 return; | 380 return; |
| 381 | 381 |
| 382 std::string dbus_connection; | 382 std::string dbus_connection; |
| 383 if (!properties.GetStringWithoutPathExpansion( | 383 if (!properties->GetStringWithoutPathExpansion( |
| 384 flimflam::kDBusConnectionProperty, &dbus_connection)) { | 384 flimflam::kDBusConnectionProperty, &dbus_connection)) { |
| 385 LOG(WARNING) << "Modem device properties do not include DBus connection."; | 385 LOG(WARNING) << "Modem device properties do not include DBus connection."; |
| 386 return; | 386 return; |
| 387 } | 387 } |
| 388 | 388 |
| 389 std::string object_path_string; | 389 std::string object_path_string; |
| 390 if (!properties.GetStringWithoutPathExpansion( | 390 if (!properties->GetStringWithoutPathExpansion( |
| 391 flimflam::kDBusObjectProperty, &object_path_string)) { | 391 flimflam::kDBusObjectProperty, &object_path_string)) { |
| 392 LOG(WARNING) << "Modem device properties do not include DBus object."; | 392 LOG(WARNING) << "Modem device properties do not include DBus object."; |
| 393 return; | 393 return; |
| 394 } | 394 } |
| 395 | 395 |
| 396 if (object_path_string.compare( | 396 if (object_path_string.compare( |
| 397 0, sizeof(modemmanager::kModemManager1ServicePath) - 1, | 397 0, sizeof(modemmanager::kModemManager1ServicePath) - 1, |
| 398 modemmanager::kModemManager1ServicePath) == 0) { | 398 modemmanager::kModemManager1ServicePath) == 0) { |
| 399 watcher_.reset( | 399 watcher_.reset( |
| 400 new ModemManager1Watcher(device_path_, callback_, dbus_connection, | 400 new ModemManager1Watcher(device_path_, callback_, dbus_connection, |
| 401 dbus::ObjectPath(object_path_string))); | 401 dbus::ObjectPath(object_path_string))); |
| 402 } else { | 402 } else { |
| 403 watcher_.reset( | 403 watcher_.reset( |
| 404 new GsmWatcher(device_path_, callback_, dbus_connection, | 404 new GsmWatcher(device_path_, callback_, dbus_connection, |
| 405 dbus::ObjectPath(object_path_string))); | 405 dbus::ObjectPath(object_path_string))); |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 | 408 |
| 409 } // namespace chromeos | 409 } // namespace chromeos |
| OLD | NEW |