OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 | 33 |
34 enum TokenHandleStatus { VALID, INVALID, UNKNOWN }; | 34 enum TokenHandleStatus { VALID, INVALID, UNKNOWN }; |
35 | 35 |
36 typedef base::Callback<void(const user_manager::UserID&, TokenHandleStatus)> | 36 typedef base::Callback<void(const user_manager::UserID&, TokenHandleStatus)> |
37 TokenValidationCallback; | 37 TokenValidationCallback; |
38 | 38 |
39 // Returns true if UserManager has token handle associated with |user_id|. | 39 // Returns true if UserManager has token handle associated with |user_id|. |
40 bool HasToken(const user_manager::UserID& user_id); | 40 bool HasToken(const user_manager::UserID& user_id); |
41 | 41 |
42 // Removes token handle for |user_id| from UserManager storage. | 42 // Removes token handle for |user_id| from UserManager storage. |
43 void DeleteToken(const user_manager::UserID& user_id); | 43 void DeleteHandle(const user_manager::UserID& user_id); |
44 | |
45 // | |
Nikita (slow)
2015/05/12 17:45:57
nit: comment is missing?
| |
46 void MarkHandleInvalid(const user_manager::UserID& user_id); | |
47 | |
48 bool ShouldObtainHandle(const user_manager::UserID& user_id); | |
Nikita (slow)
2015/05/12 17:45:57
nit: same here
| |
44 | 49 |
45 // Performs token handle check for |user_id|. Will call |callback| with | 50 // Performs token handle check for |user_id|. Will call |callback| with |
46 // corresponding result. | 51 // corresponding result. |
47 void CheckToken(const user_manager::UserID& user_id, | 52 void CheckToken(const user_manager::UserID& user_id, |
48 const TokenValidationCallback& callback); | 53 const TokenValidationCallback& callback); |
49 | 54 |
50 // Given the OAuth |access_token| attempt to obtain token handle and store it | 55 // Given the OAuth |access_token| attempt to obtain token handle and store it |
51 // for |user_id|. | 56 // for |user_id|. |
52 void GetTokenHandle(const user_manager::UserID& user_id, | 57 void GetTokenHandle(const user_manager::UserID& user_id, |
53 const std::string& access_token, | 58 const std::string& access_token, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 | 102 |
98 // Instance of GAIA Client. | 103 // Instance of GAIA Client. |
99 scoped_ptr<gaia::GaiaOAuthClient> gaia_client_; | 104 scoped_ptr<gaia::GaiaOAuthClient> gaia_client_; |
100 | 105 |
101 base::WeakPtrFactory<TokenHandleUtil> weak_factory_; | 106 base::WeakPtrFactory<TokenHandleUtil> weak_factory_; |
102 | 107 |
103 DISALLOW_COPY_AND_ASSIGN(TokenHandleUtil); | 108 DISALLOW_COPY_AND_ASSIGN(TokenHandleUtil); |
104 }; | 109 }; |
105 | 110 |
106 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_ | 111 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_ |
OLD | NEW |