Commit 5f0fdfe5 authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Commit Bot

[CrOS MultiDevice] Create HostBackendDelegate.

This class serves as the source of truth for which device is the host
for the logged-in account; additionally, it provides the ability to set
the host on the back-end.

If an attempt fails, it is retried every 5 minutes until it either
succeeds or until AttemptToSetMultiDeviceHostOnBackend() is called with
a new device.

Bug: 824568
Change-Id: I61239ac85b84d57a53b259bc05209aee751f7cee
Reviewed-on: https://chromium-review.googlesource.com/1112838
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570111}
parent 7f112aaa
...@@ -14,6 +14,10 @@ static_library("multidevice_setup") { ...@@ -14,6 +14,10 @@ static_library("multidevice_setup") {
"account_status_change_delegate_notifier.h", "account_status_change_delegate_notifier.h",
"account_status_change_delegate_notifier_impl.cc", "account_status_change_delegate_notifier_impl.cc",
"account_status_change_delegate_notifier_impl.h", "account_status_change_delegate_notifier_impl.h",
"host_backend_delegate.cc",
"host_backend_delegate.h",
"host_backend_delegate_impl.cc",
"host_backend_delegate_impl.h",
"multidevice_setup_base.cc", "multidevice_setup_base.cc",
"multidevice_setup_base.h", "multidevice_setup_base.h",
"multidevice_setup_impl.cc", "multidevice_setup_impl.cc",
...@@ -54,6 +58,8 @@ static_library("test_support") { ...@@ -54,6 +58,8 @@ static_library("test_support") {
"fake_account_status_change_delegate.cc", "fake_account_status_change_delegate.cc",
"fake_account_status_change_delegate.h", "fake_account_status_change_delegate.h",
"fake_account_status_change_delegate_notifier.h", "fake_account_status_change_delegate_notifier.h",
"fake_host_backend_delegate.cc",
"fake_host_backend_delegate.h",
"fake_multidevice_setup.cc", "fake_multidevice_setup.cc",
"fake_multidevice_setup.h", "fake_multidevice_setup.h",
"fake_setup_flow_completion_recorder.cc", "fake_setup_flow_completion_recorder.cc",
...@@ -64,6 +70,7 @@ static_library("test_support") { ...@@ -64,6 +70,7 @@ static_library("test_support") {
":multidevice_setup", ":multidevice_setup",
"//base", "//base",
"//chromeos/services/multidevice_setup/public/mojom", "//chromeos/services/multidevice_setup/public/mojom",
"//components/cryptauth",
"//testing/gmock", "//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
...@@ -74,6 +81,7 @@ source_set("unit_tests") { ...@@ -74,6 +81,7 @@ source_set("unit_tests") {
sources = [ sources = [
"account_status_change_delegate_notifier_impl_unittest.cc", "account_status_change_delegate_notifier_impl_unittest.cc",
"host_backend_delegate_impl_unittest.cc",
"multidevice_setup_impl_unittest.cc", "multidevice_setup_impl_unittest.cc",
"multidevice_setup_service_unittest.cc", "multidevice_setup_service_unittest.cc",
"setup_flow_completion_recorder_impl_unittest.cc", "setup_flow_completion_recorder_impl_unittest.cc",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/services/multidevice_setup/fake_host_backend_delegate.h"
#include "base/callback.h"
namespace chromeos {
namespace multidevice_setup {
FakeHostBackendDelegate::FakeHostBackendDelegate() : HostBackendDelegate() {}
FakeHostBackendDelegate::~FakeHostBackendDelegate() = default;
void FakeHostBackendDelegate::NotifyHostChangedOnBackend(
const base::Optional<cryptauth::RemoteDeviceRef>& host_device_on_backend) {
host_device_on_backend_ = host_device_on_backend;
if (pending_host_request_ && *pending_host_request_ == host_device_on_backend)
pending_host_request_.reset();
HostBackendDelegate::NotifyHostChangedOnBackend();
}
void FakeHostBackendDelegate::NotifyBackendRequestFailed() {
// A request must be active in order for a back-end request to fail.
DCHECK(pending_host_request_);
HostBackendDelegate::NotifyBackendRequestFailed();
}
void FakeHostBackendDelegate::AttemptToSetMultiDeviceHostOnBackend(
const base::Optional<cryptauth::RemoteDeviceRef>& host_device) {
if (host_device_on_backend_ == host_device) {
pending_host_request_.reset();
return;
}
*pending_host_request_ = host_device;
}
bool FakeHostBackendDelegate::HasPendingHostRequest() {
return pending_host_request_ != base::nullopt;
}
base::Optional<cryptauth::RemoteDeviceRef>
FakeHostBackendDelegate::GetPendingHostRequest() const {
return *pending_host_request_;
}
base::Optional<cryptauth::RemoteDeviceRef>
FakeHostBackendDelegate::GetMultiDeviceHostFromBackend() const {
return host_device_on_backend_;
}
FakeHostBackendDelegateObserver::FakeHostBackendDelegateObserver() = default;
FakeHostBackendDelegateObserver::~FakeHostBackendDelegateObserver() = default;
void FakeHostBackendDelegateObserver::OnHostChangedOnBackend() {
++num_changes_on_backend_;
}
void FakeHostBackendDelegateObserver::OnBackendRequestFailed() {
++num_failed_backend_requests_;
}
void FakeHostBackendDelegateObserver::OnPendingHostRequestChange() {
++num_pending_host_request_changes_;
}
} // namespace multidevice_setup
} // namespace chromeos
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_SERVICES_MULTIDEVICE_SETUP_FAKE_HOST_BACKEND_DELEGATE_H_
#define CHROMEOS_SERVICES_MULTIDEVICE_SETUP_FAKE_HOST_BACKEND_DELEGATE_H_
#include <utility>
#include <vector>
#include "base/callback_forward.h"
#include "base/macros.h"
#include "base/optional.h"
#include "chromeos/services/multidevice_setup/host_backend_delegate.h"
#include "components/cryptauth/remote_device_ref.h"
namespace chromeos {
namespace multidevice_setup {
// Test HostBackendDelegate implementation.
class FakeHostBackendDelegate : public HostBackendDelegate {
public:
FakeHostBackendDelegate();
~FakeHostBackendDelegate() override;
// Changes the backend host to |host_device_on_backend| and notifies
// observers.
void NotifyHostChangedOnBackend(
const base::Optional<cryptauth::RemoteDeviceRef>& host_device_on_backend);
void NotifyBackendRequestFailed();
private:
// HostBackendDelegate:
void AttemptToSetMultiDeviceHostOnBackend(
const base::Optional<cryptauth::RemoteDeviceRef>& host_device) override;
bool HasPendingHostRequest() override;
base::Optional<cryptauth::RemoteDeviceRef> GetPendingHostRequest()
const override;
base::Optional<cryptauth::RemoteDeviceRef> GetMultiDeviceHostFromBackend()
const override;
base::Optional<base::Optional<cryptauth::RemoteDeviceRef>>
pending_host_request_;
base::Optional<cryptauth::RemoteDeviceRef> host_device_on_backend_;
DISALLOW_COPY_AND_ASSIGN(FakeHostBackendDelegate);
};
// Test HostBackendDelegate::Observer implementation.
class FakeHostBackendDelegateObserver : public HostBackendDelegate::Observer {
public:
FakeHostBackendDelegateObserver();
~FakeHostBackendDelegateObserver() override;
size_t num_changes_on_backend() const { return num_changes_on_backend_; }
size_t num_failed_backend_requests() const {
return num_failed_backend_requests_;
}
size_t num_pending_host_request_changes() const {
return num_pending_host_request_changes_;
}
private:
// HostBackendDelegate::Observer:
void OnHostChangedOnBackend() override;
void OnBackendRequestFailed() override;
void OnPendingHostRequestChange() override;
size_t num_changes_on_backend_ = 0u;
size_t num_failed_backend_requests_ = 0u;
size_t num_pending_host_request_changes_ = 0u;
DISALLOW_COPY_AND_ASSIGN(FakeHostBackendDelegateObserver);
};
} // namespace multidevice_setup
} // namespace chromeos
#endif // CHROMEOS_SERVICES_MULTIDEVICE_SETUP_FAKE_HOST_BACKEND_DELEGATE_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/services/multidevice_setup/host_backend_delegate.h"
namespace chromeos {
namespace multidevice_setup {
HostBackendDelegate::HostBackendDelegate() = default;
HostBackendDelegate::~HostBackendDelegate() = default;
void HostBackendDelegate::AddObserver(Observer* observer) {
observer_list_.AddObserver(observer);
}
void HostBackendDelegate::RemoveObserver(Observer* observer) {
observer_list_.RemoveObserver(observer);
}
void HostBackendDelegate::NotifyHostChangedOnBackend() {
for (auto& observer : observer_list_)
observer.OnHostChangedOnBackend();
}
void HostBackendDelegate::NotifyBackendRequestFailed() {
for (auto& observer : observer_list_)
observer.OnBackendRequestFailed();
}
void HostBackendDelegate::NotifyPendingHostRequestChange() {
for (auto& observer : observer_list_)
observer.OnPendingHostRequestChange();
}
} // namespace multidevice_setup
} // namespace chromeos
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_SERVICES_MULTIDEVICE_SETUP_HOST_BACKEND_DELEGATE_H_
#define CHROMEOS_SERVICES_MULTIDEVICE_SETUP_HOST_BACKEND_DELEGATE_H_
#include "base/callback_forward.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/optional.h"
#include "components/cryptauth/remote_device_ref.h"
namespace chromeos {
namespace multidevice_setup {
// Delegate for setting and receiving the MultiDevice host from the back-end.
// This class is considered the source of truth for the most recent snapshot of
// what the server knows about.
class HostBackendDelegate {
public:
class Observer {
public:
virtual ~Observer() = default;
// Invoked when the host has changed. The new host can be retrieved via
// GetMultiDeviceHostFromBackend().
//
// Note that this function is invoked when the host changes from one device
// to another, from a device to no device at all, or from no device at all
// to a device. The function is not invoked when an individual property of
// the host device changes (i.e., this function is only invoked when the
// previous host's device ID is different fro the new host's device ID).
virtual void OnHostChangedOnBackend() {}
// Invoked when an attempt to set the MultiDevice host failed. The device
// whose attempt failed can be retrieved via GetPendingHostRequest().
virtual void OnBackendRequestFailed() {}
// Invoked when the pending host request has changed. Note that this
// callback is also fired when a HasPendingHostRequest() changes from true
// to false.
virtual void OnPendingHostRequestChange() {}
};
virtual ~HostBackendDelegate();
// Attempts to set |host_device| as the host on the back-end. If |host_device|
// is null, this function attempts to remove the active host device.
//
// If the request is successful, the OnHostChangedOnBackend() observer
// function is invoked.
//
// If a the request fails (e.g., the device is offline or the server is down),
// the OnBackendRequestFailed() observer function is invoked, but this
// object continues to attempt the request until the request succeeds or until
// AttemptToSetMultiDeviceHostOnBackend() is called with a new device.
virtual void AttemptToSetMultiDeviceHostOnBackend(
const base::Optional<cryptauth::RemoteDeviceRef>& host_device) = 0;
// Returns whether there is a pending request to set the host on the back-end
// which has not yet completed.
virtual bool HasPendingHostRequest() = 0;
// Returns the device which is pending to be set as the host device. If null
// is returned, this means that the current host is pending removal.
//
// This function invokes a crash if called when HasPendingHostRequest()
// returns false.
virtual base::Optional<cryptauth::RemoteDeviceRef> GetPendingHostRequest()
const = 0;
// Provides the host from the most recent device sync. If the return value is
// null, there is no host set on the back-end.
virtual base::Optional<cryptauth::RemoteDeviceRef>
GetMultiDeviceHostFromBackend() const = 0;
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
protected:
HostBackendDelegate();
void NotifyHostChangedOnBackend();
void NotifyBackendRequestFailed();
void NotifyPendingHostRequestChange();
private:
base::ObserverList<Observer> observer_list_;
DISALLOW_COPY_AND_ASSIGN(HostBackendDelegate);
};
} // namespace multidevice_setup
} // namespace chromeos
#endif // CHROMEOS_SERVICES_MULTIDEVICE_SETUP_HOST_BACKEND_DELEGATE_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_SERVICES_MULTIDEVICE_SETUP_HOST_BACKEND_DELEGATE_IMPL_H_
#define CHROMEOS_SERVICES_MULTIDEVICE_SETUP_HOST_BACKEND_DELEGATE_IMPL_H_
#include "base/callback_forward.h"
#include "base/containers/flat_map.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "chromeos/services/device_sync/public/cpp/device_sync_client.h"
#include "chromeos/services/multidevice_setup/host_backend_delegate.h"
#include "components/cryptauth/remote_device_ref.h"
class PrefRegistrySimple;
class PrefService;
namespace chromeos {
namespace multidevice_setup {
// Concrete HostBackendDelegate implementation, which utilizes
// DeviceSyncClient to communicate with the back-end.
class HostBackendDelegateImpl : public HostBackendDelegate,
public device_sync::DeviceSyncClient::Observer {
public:
class Factory {
public:
static Factory* Get();
static void SetFactoryForTesting(Factory* test_factory);
virtual ~Factory();
virtual std::unique_ptr<HostBackendDelegate> BuildInstance(
PrefService* pref_service,
device_sync::DeviceSyncClient* device_sync_client,
std::unique_ptr<base::OneShotTimer> timer =
std::make_unique<base::OneShotTimer>());
private:
static Factory* test_factory_;
};
static void RegisterPrefs(PrefRegistrySimple* registry);
~HostBackendDelegateImpl() override;
private:
HostBackendDelegateImpl(PrefService* pref_service,
device_sync::DeviceSyncClient* device_sync_client,
std::unique_ptr<base::OneShotTimer> timer);
// HostBackendDelegate:
void AttemptToSetMultiDeviceHostOnBackend(
const base::Optional<cryptauth::RemoteDeviceRef>& host_device) override;
bool HasPendingHostRequest() override;
base::Optional<cryptauth::RemoteDeviceRef> GetPendingHostRequest()
const override;
base::Optional<cryptauth::RemoteDeviceRef> GetMultiDeviceHostFromBackend()
const override;
// DeviceSyncClient::Observer:
void OnNewDevicesSynced() override;
// Sets the pending host request. To signal that the request is to remove the
// current host, pass kPendingRemovalOfCurrentHost. To signal that there is no
// pending request, pass kNoPendingRequest.
void SetPendingHostRequest(const std::string& host_device_id);
void AttemptNetworkRequest(bool is_retry);
base::Optional<cryptauth::RemoteDeviceRef> GetHostFromDeviceSync();
void OnSetSoftwareFeatureStateResult(
cryptauth::RemoteDeviceRef device_for_request,
bool attempted_to_enable,
const base::Optional<std::string>& error_code);
PrefService* pref_service_;
device_sync::DeviceSyncClient* device_sync_client_;
std::unique_ptr<base::OneShotTimer> timer_;
// The most-recent snapshot of the host on the back-end.
base::Optional<cryptauth::RemoteDeviceRef> host_from_last_sync_;
base::WeakPtrFactory<HostBackendDelegateImpl> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(HostBackendDelegateImpl);
};
} // namespace multidevice_setup
} // namespace chromeos
#endif // CHROMEOS_SERVICES_MULTIDEVICE_SETUP_HOST_BACKEND_DELEGATE_IMPL_H_
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/time/default_clock.h" #include "base/time/default_clock.h"
#include "chromeos/components/proximity_auth/logging/logging.h" #include "chromeos/components/proximity_auth/logging/logging.h"
#include "chromeos/services/multidevice_setup/account_status_change_delegate_notifier_impl.h" #include "chromeos/services/multidevice_setup/account_status_change_delegate_notifier_impl.h"
#include "chromeos/services/multidevice_setup/host_backend_delegate_impl.h"
#include "chromeos/services/multidevice_setup/setup_flow_completion_recorder_impl.h" #include "chromeos/services/multidevice_setup/setup_flow_completion_recorder_impl.h"
namespace chromeos { namespace chromeos {
...@@ -49,7 +50,11 @@ MultiDeviceSetupImpl::MultiDeviceSetupImpl( ...@@ -49,7 +50,11 @@ MultiDeviceSetupImpl::MultiDeviceSetupImpl(
PrefService* pref_service, PrefService* pref_service,
device_sync::DeviceSyncClient* device_sync_client, device_sync::DeviceSyncClient* device_sync_client,
secure_channel::SecureChannelClient* secure_channel_client) secure_channel::SecureChannelClient* secure_channel_client)
: setup_flow_completion_recorder_( : host_backend_delegate_(
HostBackendDelegateImpl::Factory::Get()->BuildInstance(
pref_service,
device_sync_client)),
setup_flow_completion_recorder_(
SetupFlowCompletionRecorderImpl::Factory::Get()->BuildInstance( SetupFlowCompletionRecorderImpl::Factory::Get()->BuildInstance(
pref_service, pref_service,
base::DefaultClock::GetInstance())), base::DefaultClock::GetInstance())),
......
...@@ -25,6 +25,7 @@ class SecureChannelClient; ...@@ -25,6 +25,7 @@ class SecureChannelClient;
namespace multidevice_setup { namespace multidevice_setup {
class AccountStatusChangeDelegateNotifier; class AccountStatusChangeDelegateNotifier;
class HostBackendDelegate;
class SetupFlowCompletionRecorder; class SetupFlowCompletionRecorder;
// Concrete MultiDeviceSetup implementation. // Concrete MultiDeviceSetup implementation.
...@@ -59,6 +60,7 @@ class MultiDeviceSetupImpl : public mojom::MultiDeviceSetup { ...@@ -59,6 +60,7 @@ class MultiDeviceSetupImpl : public mojom::MultiDeviceSetup {
mojom::EventTypeForDebugging type, mojom::EventTypeForDebugging type,
TriggerEventForDebuggingCallback callback) override; TriggerEventForDebuggingCallback callback) override;
std::unique_ptr<HostBackendDelegate> host_backend_delegate_;
std::unique_ptr<SetupFlowCompletionRecorder> setup_flow_completion_recorder_; std::unique_ptr<SetupFlowCompletionRecorder> setup_flow_completion_recorder_;
std::unique_ptr<AccountStatusChangeDelegateNotifier> delegate_notifier_; std::unique_ptr<AccountStatusChangeDelegateNotifier> delegate_notifier_;
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
#include "chromeos/services/multidevice_setup/account_status_change_delegate_notifier_impl.h" #include "chromeos/services/multidevice_setup/account_status_change_delegate_notifier_impl.h"
#include "chromeos/services/multidevice_setup/fake_account_status_change_delegate.h" #include "chromeos/services/multidevice_setup/fake_account_status_change_delegate.h"
#include "chromeos/services/multidevice_setup/fake_account_status_change_delegate_notifier.h" #include "chromeos/services/multidevice_setup/fake_account_status_change_delegate_notifier.h"
#include "chromeos/services/multidevice_setup/fake_host_backend_delegate.h"
#include "chromeos/services/multidevice_setup/fake_setup_flow_completion_recorder.h" #include "chromeos/services/multidevice_setup/fake_setup_flow_completion_recorder.h"
#include "chromeos/services/multidevice_setup/host_backend_delegate_impl.h"
#include "chromeos/services/multidevice_setup/multidevice_setup_impl.h" #include "chromeos/services/multidevice_setup/multidevice_setup_impl.h"
#include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h" #include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h"
#include "chromeos/services/multidevice_setup/setup_flow_completion_recorder_impl.h" #include "chromeos/services/multidevice_setup/setup_flow_completion_recorder_impl.h"
...@@ -24,6 +26,42 @@ namespace multidevice_setup { ...@@ -24,6 +26,42 @@ namespace multidevice_setup {
namespace { namespace {
class FakeHostBackendDelegateFactory : public HostBackendDelegateImpl::Factory {
public:
FakeHostBackendDelegateFactory(
sync_preferences::TestingPrefServiceSyncable*
expected_testing_pref_service,
device_sync::FakeDeviceSyncClient* expected_device_sync_client)
: expected_testing_pref_service_(expected_testing_pref_service),
expected_device_sync_client_(expected_device_sync_client) {}
~FakeHostBackendDelegateFactory() override = default;
FakeHostBackendDelegate* instance() { return instance_; }
private:
// HostBackendDelegateImpl::Factory:
std::unique_ptr<HostBackendDelegate> BuildInstance(
PrefService* pref_service,
device_sync::DeviceSyncClient* device_sync_client,
std::unique_ptr<base::OneShotTimer> timer) override {
EXPECT_FALSE(instance_);
EXPECT_EQ(expected_testing_pref_service_, pref_service);
EXPECT_EQ(expected_device_sync_client_, device_sync_client);
auto instance = std::make_unique<FakeHostBackendDelegate>();
instance_ = instance.get();
return instance;
}
sync_preferences::TestingPrefServiceSyncable* expected_testing_pref_service_;
device_sync::FakeDeviceSyncClient* expected_device_sync_client_;
FakeHostBackendDelegate* instance_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(FakeHostBackendDelegateFactory);
};
class FakeSetupFlowCompletionRecorderFactory class FakeSetupFlowCompletionRecorderFactory
: public SetupFlowCompletionRecorderImpl::Factory { : public SetupFlowCompletionRecorderImpl::Factory {
public: public:
...@@ -117,6 +155,12 @@ class MultiDeviceSetupImplTest : public testing::Test { ...@@ -117,6 +155,12 @@ class MultiDeviceSetupImplTest : public testing::Test {
fake_secure_channel_client_ = fake_secure_channel_client_ =
std::make_unique<secure_channel::FakeSecureChannelClient>(); std::make_unique<secure_channel::FakeSecureChannelClient>();
fake_host_backend_delegate_factory_ =
std::make_unique<FakeHostBackendDelegateFactory>(
test_pref_service_.get(), fake_device_sync_client_.get());
HostBackendDelegateImpl::Factory::SetFactoryForTesting(
fake_host_backend_delegate_factory_.get());
fake_setup_flow_completion_recorder_factory_ = fake_setup_flow_completion_recorder_factory_ =
std::make_unique<FakeSetupFlowCompletionRecorderFactory>( std::make_unique<FakeSetupFlowCompletionRecorderFactory>(
test_pref_service_.get()); test_pref_service_.get());
...@@ -136,6 +180,7 @@ class MultiDeviceSetupImplTest : public testing::Test { ...@@ -136,6 +180,7 @@ class MultiDeviceSetupImplTest : public testing::Test {
} }
void TearDown() override { void TearDown() override {
HostBackendDelegateImpl::Factory::SetFactoryForTesting(nullptr);
SetupFlowCompletionRecorderImpl::Factory::SetFactoryForTesting(nullptr); SetupFlowCompletionRecorderImpl::Factory::SetFactoryForTesting(nullptr);
AccountStatusChangeDelegateNotifierImpl::Factory::SetFactoryForTesting( AccountStatusChangeDelegateNotifierImpl::Factory::SetFactoryForTesting(
nullptr); nullptr);
...@@ -195,6 +240,8 @@ class MultiDeviceSetupImplTest : public testing::Test { ...@@ -195,6 +240,8 @@ class MultiDeviceSetupImplTest : public testing::Test {
std::unique_ptr<secure_channel::FakeSecureChannelClient> std::unique_ptr<secure_channel::FakeSecureChannelClient>
fake_secure_channel_client_; fake_secure_channel_client_;
std::unique_ptr<FakeHostBackendDelegateFactory>
fake_host_backend_delegate_factory_;
std::unique_ptr<FakeSetupFlowCompletionRecorderFactory> std::unique_ptr<FakeSetupFlowCompletionRecorderFactory>
fake_setup_flow_completion_recorder_factory_; fake_setup_flow_completion_recorder_factory_;
std::unique_ptr<FakeAccountStatusChangeDelegateNotifierFactory> std::unique_ptr<FakeAccountStatusChangeDelegateNotifierFactory>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "chromeos/components/proximity_auth/logging/logging.h" #include "chromeos/components/proximity_auth/logging/logging.h"
#include "chromeos/services/multidevice_setup/account_status_change_delegate_notifier_impl.h" #include "chromeos/services/multidevice_setup/account_status_change_delegate_notifier_impl.h"
#include "chromeos/services/multidevice_setup/host_backend_delegate_impl.h"
#include "chromeos/services/multidevice_setup/multidevice_setup_base.h" #include "chromeos/services/multidevice_setup/multidevice_setup_base.h"
#include "chromeos/services/multidevice_setup/multidevice_setup_initializer.h" #include "chromeos/services/multidevice_setup/multidevice_setup_initializer.h"
...@@ -17,6 +18,7 @@ namespace multidevice_setup { ...@@ -17,6 +18,7 @@ namespace multidevice_setup {
void MultiDeviceSetupService::RegisterProfilePrefs( void MultiDeviceSetupService::RegisterProfilePrefs(
PrefRegistrySimple* registry) { PrefRegistrySimple* registry) {
AccountStatusChangeDelegateNotifierImpl::RegisterPrefs(registry); AccountStatusChangeDelegateNotifierImpl::RegisterPrefs(registry);
HostBackendDelegateImpl::RegisterPrefs(registry);
} }
MultiDeviceSetupService::MultiDeviceSetupService( MultiDeviceSetupService::MultiDeviceSetupService(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment