dummy_auth_service.cc 994 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2013 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 "google_apis/common/dummy_auth_service.h"
  5. namespace google_apis {
  6. DummyAuthService::DummyAuthService() {
  7. set_access_token("dummy");
  8. set_refresh_token("dummy");
  9. }
  10. void DummyAuthService::AddObserver(AuthServiceObserver* observer) {}
  11. void DummyAuthService::RemoveObserver(AuthServiceObserver* observer) {}
  12. void DummyAuthService::StartAuthentication(AuthStatusCallback callback) {}
  13. bool DummyAuthService::HasAccessToken() const {
  14. return !access_token_.empty();
  15. }
  16. bool DummyAuthService::HasRefreshToken() const {
  17. return !refresh_token_.empty();
  18. }
  19. const std::string& DummyAuthService::access_token() const {
  20. return access_token_;
  21. }
  22. void DummyAuthService::ClearAccessToken() {
  23. access_token_.clear();
  24. }
  25. void DummyAuthService::ClearRefreshToken() {
  26. refresh_token_.clear();
  27. }
  28. } // namespace google_apis