| 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/flimflam_manager_client.h" | 5 #include "chromeos/dbus/flimflam_manager_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(FlimflamManagerClientImpl); | 143 DISALLOW_COPY_AND_ASSIGN(FlimflamManagerClientImpl); |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 // A stub implementation of FlimflamManagerClient. | 146 // A stub implementation of FlimflamManagerClient. |
| 147 // Implemented: Stub cellular DeviceList entry for SMS testing. | 147 // Implemented: Stub cellular DeviceList entry for SMS testing. |
| 148 class FlimflamManagerClientStubImpl : public FlimflamManagerClient { | 148 class FlimflamManagerClientStubImpl : public FlimflamManagerClient { |
| 149 public: | 149 public: |
| 150 FlimflamManagerClientStubImpl() : weak_ptr_factory_(this) { | 150 FlimflamManagerClientStubImpl() : weak_ptr_factory_(this) { |
| 151 base::ListValue* device_list = new base::ListValue; | 151 base::ListValue* device_list = new base::ListValue; |
| 152 // Note: name matches Device stub map. | 152 // Note: names match Device stub map. |
| 153 const char kStubCellular1[] = "stub_cellular1"; | 153 const char kStubCellular1[] = "stub_cellular1"; |
| 154 const char kStubCellular2[] = "stub_cellular2"; |
| 154 device_list->Append(base::Value::CreateStringValue(kStubCellular1)); | 155 device_list->Append(base::Value::CreateStringValue(kStubCellular1)); |
| 156 device_list->Append(base::Value::CreateStringValue(kStubCellular2)); |
| 155 stub_properties_.Set(flimflam::kDevicesProperty, device_list); | 157 stub_properties_.Set(flimflam::kDevicesProperty, device_list); |
| 156 } | 158 } |
| 157 | 159 |
| 158 virtual ~FlimflamManagerClientStubImpl() {} | 160 virtual ~FlimflamManagerClientStubImpl() {} |
| 159 | 161 |
| 160 // FlimflamManagerClient override. | 162 // FlimflamManagerClient override. |
| 161 virtual void SetPropertyChangedHandler( | 163 virtual void SetPropertyChangedHandler( |
| 162 const PropertyChangedHandler& handler) OVERRIDE {} | 164 const PropertyChangedHandler& handler) OVERRIDE {} |
| 163 | 165 |
| 164 // FlimflamManagerClient override. | 166 // FlimflamManagerClient override. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 FlimflamManagerClient* FlimflamManagerClient::Create( | 252 FlimflamManagerClient* FlimflamManagerClient::Create( |
| 251 DBusClientImplementationType type, | 253 DBusClientImplementationType type, |
| 252 dbus::Bus* bus) { | 254 dbus::Bus* bus) { |
| 253 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 255 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
| 254 return new FlimflamManagerClientImpl(bus); | 256 return new FlimflamManagerClientImpl(bus); |
| 255 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 257 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
| 256 return new FlimflamManagerClientStubImpl(); | 258 return new FlimflamManagerClientStubImpl(); |
| 257 } | 259 } |
| 258 | 260 |
| 259 } // namespace chromeos | 261 } // namespace chromeos |
| OLD | NEW |