| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/dbus_clients_browser.h" | 5 #include "chromeos/dbus/dbus_clients_browser.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chromeos/dbus/arc_obb_mounter_client.h" | 8 #include "chromeos/dbus/arc_obb_mounter_client.h" |
| 9 #include "chromeos/dbus/auth_policy_client.h" | 9 #include "chromeos/dbus/auth_policy_client.h" |
| 10 #include "chromeos/dbus/cros_disks_client.h" | 10 #include "chromeos/dbus/cros_disks_client.h" |
| 11 #include "chromeos/dbus/dbus_client_implementation_type.h" | 11 #include "chromeos/dbus/dbus_client_implementation_type.h" |
| 12 #include "chromeos/dbus/dbus_thread_manager.h" | 12 #include "chromeos/dbus/dbus_thread_manager.h" |
| 13 #include "chromeos/dbus/debug_daemon_client.h" | 13 #include "chromeos/dbus/debug_daemon_client.h" |
| 14 #include "chromeos/dbus/easy_unlock_client.h" | 14 #include "chromeos/dbus/easy_unlock_client.h" |
| 15 #include "chromeos/dbus/fake_arc_obb_mounter_client.h" | 15 #include "chromeos/dbus/fake_arc_obb_mounter_client.h" |
| 16 #include "chromeos/dbus/fake_auth_policy_client.h" | 16 #include "chromeos/dbus/fake_auth_policy_client.h" |
| 17 #include "chromeos/dbus/fake_debug_daemon_client.h" | 17 #include "chromeos/dbus/fake_debug_daemon_client.h" |
| 18 #include "chromeos/dbus/fake_easy_unlock_client.h" | 18 #include "chromeos/dbus/fake_easy_unlock_client.h" |
| 19 #include "chromeos/dbus/fake_image_burner_client.h" | 19 #include "chromeos/dbus/fake_image_burner_client.h" |
| 20 #include "chromeos/dbus/fake_image_loader_client.h" | 20 #include "chromeos/dbus/fake_image_loader_client.h" |
| 21 #include "chromeos/dbus/fake_lorgnette_manager_client.h" | 21 #include "chromeos/dbus/fake_lorgnette_manager_client.h" |
| 22 #include "chromeos/dbus/fake_media_analytics_client.h" |
| 22 #include "chromeos/dbus/fake_upstart_client.h" | 23 #include "chromeos/dbus/fake_upstart_client.h" |
| 23 #include "chromeos/dbus/image_burner_client.h" | 24 #include "chromeos/dbus/image_burner_client.h" |
| 24 #include "chromeos/dbus/image_loader_client.h" | 25 #include "chromeos/dbus/image_loader_client.h" |
| 25 #include "chromeos/dbus/lorgnette_manager_client.h" | 26 #include "chromeos/dbus/lorgnette_manager_client.h" |
| 27 #include "chromeos/dbus/media_analytics_client.h" |
| 26 #include "chromeos/dbus/upstart_client.h" | 28 #include "chromeos/dbus/upstart_client.h" |
| 27 | 29 |
| 28 namespace chromeos { | 30 namespace chromeos { |
| 29 | 31 |
| 30 DBusClientsBrowser::DBusClientsBrowser(bool use_real_clients) { | 32 DBusClientsBrowser::DBusClientsBrowser(bool use_real_clients) { |
| 31 if (use_real_clients) | 33 if (use_real_clients) |
| 32 arc_obb_mounter_client_.reset(ArcObbMounterClient::Create()); | 34 arc_obb_mounter_client_.reset(ArcObbMounterClient::Create()); |
| 33 else | 35 else |
| 34 arc_obb_mounter_client_.reset(new FakeArcObbMounterClient); | 36 arc_obb_mounter_client_.reset(new FakeArcObbMounterClient); |
| 35 | 37 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 61 image_loader_client_.reset(ImageLoaderClient::Create()); | 63 image_loader_client_.reset(ImageLoaderClient::Create()); |
| 62 else | 64 else |
| 63 image_loader_client_.reset(new FakeImageLoaderClient); | 65 image_loader_client_.reset(new FakeImageLoaderClient); |
| 64 | 66 |
| 65 if (use_real_clients) | 67 if (use_real_clients) |
| 66 lorgnette_manager_client_.reset(LorgnetteManagerClient::Create()); | 68 lorgnette_manager_client_.reset(LorgnetteManagerClient::Create()); |
| 67 else | 69 else |
| 68 lorgnette_manager_client_.reset(new FakeLorgnetteManagerClient); | 70 lorgnette_manager_client_.reset(new FakeLorgnetteManagerClient); |
| 69 | 71 |
| 70 if (use_real_clients) | 72 if (use_real_clients) |
| 73 media_analytics_client_.reset(MediaAnalyticsClient::Create()); |
| 74 else |
| 75 media_analytics_client_.reset(new FakeMediaAnalyticsClient); |
| 76 |
| 77 if (use_real_clients) |
| 71 upstart_client_.reset(UpstartClient::Create()); | 78 upstart_client_.reset(UpstartClient::Create()); |
| 72 else | 79 else |
| 73 upstart_client_.reset(new FakeUpstartClient); | 80 upstart_client_.reset(new FakeUpstartClient); |
| 74 } | 81 } |
| 75 | 82 |
| 76 DBusClientsBrowser::~DBusClientsBrowser() {} | 83 DBusClientsBrowser::~DBusClientsBrowser() {} |
| 77 | 84 |
| 78 void DBusClientsBrowser::Initialize(dbus::Bus* system_bus) { | 85 void DBusClientsBrowser::Initialize(dbus::Bus* system_bus) { |
| 79 DCHECK(DBusThreadManager::IsInitialized()); | 86 DCHECK(DBusThreadManager::IsInitialized()); |
| 80 | 87 |
| 81 arc_obb_mounter_client_->Init(system_bus); | 88 arc_obb_mounter_client_->Init(system_bus); |
| 82 auth_policy_client_->Init(system_bus); | 89 auth_policy_client_->Init(system_bus); |
| 83 cros_disks_client_->Init(system_bus); | 90 cros_disks_client_->Init(system_bus); |
| 84 debug_daemon_client_->Init(system_bus); | 91 debug_daemon_client_->Init(system_bus); |
| 85 easy_unlock_client_->Init(system_bus); | 92 easy_unlock_client_->Init(system_bus); |
| 86 image_burner_client_->Init(system_bus); | 93 image_burner_client_->Init(system_bus); |
| 87 image_loader_client_->Init(system_bus); | 94 image_loader_client_->Init(system_bus); |
| 88 lorgnette_manager_client_->Init(system_bus); | 95 lorgnette_manager_client_->Init(system_bus); |
| 96 media_analytics_client_->Init(system_bus); |
| 89 upstart_client_->Init(system_bus); | 97 upstart_client_->Init(system_bus); |
| 90 } | 98 } |
| 91 | 99 |
| 92 } // namespace chromeos | 100 } // namespace chromeos |
| OLD | NEW |