| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/biod/biod_client.h" | 5 #include "chromeos/dbus/biod/biod_client.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chromeos/dbus/biod/fake_biod_client.h" |
| 11 #include "dbus/bus.h" | 12 #include "dbus/bus.h" |
| 12 #include "dbus/message.h" | 13 #include "dbus/message.h" |
| 13 #include "dbus/object_path.h" | 14 #include "dbus/object_path.h" |
| 14 #include "dbus/object_proxy.h" | 15 #include "dbus/object_proxy.h" |
| 15 | 16 |
| 16 namespace chromeos { | 17 namespace chromeos { |
| 17 | 18 |
| 18 // The BiodClient implementation used in production. | 19 // The BiodClient implementation used in production. |
| 19 class BiodClientImpl : public BiodClient { | 20 class BiodClientImpl : public BiodClient { |
| 20 public: | 21 public: |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 base::WeakPtrFactory<BiodClientImpl> weak_ptr_factory_; | 350 base::WeakPtrFactory<BiodClientImpl> weak_ptr_factory_; |
| 350 | 351 |
| 351 DISALLOW_COPY_AND_ASSIGN(BiodClientImpl); | 352 DISALLOW_COPY_AND_ASSIGN(BiodClientImpl); |
| 352 }; | 353 }; |
| 353 | 354 |
| 354 BiodClient::BiodClient() {} | 355 BiodClient::BiodClient() {} |
| 355 | 356 |
| 356 BiodClient::~BiodClient() {} | 357 BiodClient::~BiodClient() {} |
| 357 | 358 |
| 358 // static | 359 // static |
| 359 BiodClient* BiodClient::Create(DBusClientImplementationType /* type */) { | 360 BiodClient* BiodClient::Create(DBusClientImplementationType type) { |
| 360 return new BiodClientImpl(); | 361 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
| 362 return new BiodClientImpl(); |
| 363 DCHECK_EQ(FAKE_DBUS_CLIENT_IMPLEMENTATION, type); |
| 364 return new FakeBiodClient(); |
| 361 } | 365 } |
| 362 | 366 |
| 363 } // namespace chromeos | 367 } // namespace chromeos |
| OLD | NEW |