| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "components/signin/core/browser/signin_manager.h" | 13 #include "components/signin/core/browser/signin_manager.h" |
| 14 #include "components/signin/core/browser/signin_metrics.h" | 14 #include "components/signin/core/browser/signin_metrics.h" |
| 15 | 15 |
| 16 // SigninManager to use for testing. Tests should use the type | 16 // SigninManager to use for testing. Tests should use the type |
| 17 // SigninManagerForTesting to ensure that the right type for their platform is | 17 // SigninManagerForTesting to ensure that the right type for their platform is |
| 18 // used. | 18 // used. |
| 19 | 19 |
| 20 // Overrides InitTokenService to do-nothing in tests. | 20 // Overrides InitTokenService to do-nothing in tests. |
| 21 class FakeSigninManagerBase : public SigninManagerBase { | 21 class FakeSigninManagerBase : public SigninManagerBase { |
| 22 public: | 22 public: |
| 23 FakeSigninManagerBase(SigninClient* client, | 23 FakeSigninManagerBase(SigninClient* client, |
| 24 AccountTrackerService* account_tracker_service); | 24 AccountTrackerService* account_tracker_service); |
| 25 ~FakeSigninManagerBase() override; | 25 ~FakeSigninManagerBase() override; |
| 26 | |
| 27 void SignIn(const std::string& account_id); | |
| 28 }; | 26 }; |
| 29 | 27 |
| 30 #if !defined(OS_CHROMEOS) | 28 #if !defined(OS_CHROMEOS) |
| 31 | 29 |
| 32 // A signin manager that bypasses actual authentication routines with servers | 30 // A signin manager that bypasses actual authentication routines with servers |
| 33 // and accepts the credentials provided to StartSignIn. | 31 // and accepts the credentials provided to StartSignIn. |
| 34 class FakeSigninManager : public SigninManager { | 32 class FakeSigninManager : public SigninManager { |
| 35 public: | 33 public: |
| 36 FakeSigninManager(SigninClient* client, | 34 FakeSigninManager(SigninClient* client, |
| 37 ProfileOAuth2TokenService* token_service, | 35 ProfileOAuth2TokenService* token_service, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 65 | 63 |
| 66 void CompletePendingSignin() override; | 64 void CompletePendingSignin() override; |
| 67 | 65 |
| 68 // Username specified in StartSignInWithRefreshToken() call. | 66 // Username specified in StartSignInWithRefreshToken() call. |
| 69 std::string username_; | 67 std::string username_; |
| 70 }; | 68 }; |
| 71 | 69 |
| 72 #endif // !defined (OS_CHROMEOS) | 70 #endif // !defined (OS_CHROMEOS) |
| 73 | 71 |
| 74 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ | 72 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ |
| OLD | NEW |