host_verifier.cc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/services/multidevice_setup/host_verifier.h"
  5. #include "ash/components/multidevice/logging/logging.h"
  6. #include "base/logging.h"
  7. namespace ash {
  8. namespace multidevice_setup {
  9. HostVerifier::HostVerifier() = default;
  10. HostVerifier::~HostVerifier() = default;
  11. void HostVerifier::AttemptVerificationNow() {
  12. if (IsHostVerified()) {
  13. PA_LOG(ERROR) << "HostVerifier::AttemptVerificationNow(): Attempted to "
  14. << "start verification, but the current host has already "
  15. << "been verified.";
  16. NOTREACHED();
  17. }
  18. PerformAttemptVerificationNow();
  19. }
  20. void HostVerifier::AddObserver(Observer* observer) {
  21. observer_list_.AddObserver(observer);
  22. }
  23. void HostVerifier::RemoveObserver(Observer* observer) {
  24. observer_list_.RemoveObserver(observer);
  25. }
  26. void HostVerifier::NotifyHostVerified() {
  27. for (auto& observer : observer_list_)
  28. observer.OnHostVerified();
  29. }
  30. } // namespace multidevice_setup
  31. } // namespace ash