OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_CHROMEOS_POLICY_WILDCARD_LOGIN_CHECKER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_WILDCARD_LOGIN_CHECKER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_WILDCARD_LOGIN_CHECKER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_WILDCARD_LOGIN_CHECKER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 typedef base::Callback<void(Result)> StatusCallback; | 35 typedef base::Callback<void(Result)> StatusCallback; |
36 | 36 |
37 WildcardLoginChecker(); | 37 WildcardLoginChecker(); |
38 virtual ~WildcardLoginChecker(); | 38 virtual ~WildcardLoginChecker(); |
39 | 39 |
40 // Starts checking. The result will be reported via |callback_|. | 40 // Starts checking. The result will be reported via |callback_|. |
41 void Start(scoped_refptr<net::URLRequestContextGetter> signin_context, | 41 void Start(scoped_refptr<net::URLRequestContextGetter> signin_context, |
42 const StatusCallback& callback); | 42 const StatusCallback& callback); |
43 | 43 |
| 44 // Starts checking with a provided refresh token. |
| 45 void StartWithRefreshToken(const std::string& refresh_token, |
| 46 const StatusCallback& callback); |
| 47 |
44 // Starts checking with a provided access token. | 48 // Starts checking with a provided access token. |
45 void StartWithAccessToken(const std::string& access_token, | 49 void StartWithAccessToken(const std::string& access_token, |
46 const StatusCallback& callback); | 50 const StatusCallback& callback); |
47 | 51 |
48 // UserInfoFetcher::Delegate: | 52 // UserInfoFetcher::Delegate: |
49 void OnGetUserInfoSuccess(const base::DictionaryValue* response) override; | 53 void OnGetUserInfoSuccess(const base::DictionaryValue* response) override; |
50 void OnGetUserInfoFailure(const GoogleServiceAuthError& error) override; | 54 void OnGetUserInfoFailure(const GoogleServiceAuthError& error) override; |
51 | 55 |
52 private: | 56 private: |
53 // Starts the check after successful token minting. | 57 // Starts the check after successful token minting. |
(...skipping 13 matching lines...) Expand all Loading... |
67 | 71 |
68 base::Time start_timestamp_; | 72 base::Time start_timestamp_; |
69 base::Time token_available_timestamp_; | 73 base::Time token_available_timestamp_; |
70 | 74 |
71 DISALLOW_COPY_AND_ASSIGN(WildcardLoginChecker); | 75 DISALLOW_COPY_AND_ASSIGN(WildcardLoginChecker); |
72 }; | 76 }; |
73 | 77 |
74 } // namespace policy | 78 } // namespace policy |
75 | 79 |
76 #endif // CHROME_BROWSER_CHROMEOS_POLICY_WILDCARD_LOGIN_CHECKER_H_ | 80 #endif // CHROME_BROWSER_CHROMEOS_POLICY_WILDCARD_LOGIN_CHECKER_H_ |
OLD | NEW |