remote_device_life_cycle.cc 916 B

1234567891011121314151617181920212223242526272829303132333435
  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/components/proximity_auth/remote_device_life_cycle.h"
  5. namespace proximity_auth {
  6. namespace {
  7. using State = RemoteDeviceLifeCycle::State;
  8. } // namespace
  9. std::ostream& operator<<(std::ostream& stream, const State& state) {
  10. switch (state) {
  11. case State::STOPPED:
  12. stream << "[stopped]";
  13. break;
  14. case State::FINDING_CONNECTION:
  15. stream << "[finding connection]";
  16. break;
  17. case State::AUTHENTICATING:
  18. stream << "[authenticating]";
  19. break;
  20. case State::SECURE_CHANNEL_ESTABLISHED:
  21. stream << "[secure channel established]";
  22. break;
  23. case State::AUTHENTICATION_FAILED:
  24. stream << "[authentication failed]";
  25. break;
  26. }
  27. return stream;
  28. }
  29. } // namespace proximity_auth