| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 const std::string& login_token, | 90 const std::string& login_token, |
| 91 const std::string& login_captcha) = 0; | 91 const std::string& login_captcha) = 0; |
| 92 | 92 |
| 93 // Kicks of verification of OAuth1 access token. | 93 // Kicks of verification of OAuth1 access token. |
| 94 virtual void VerifyOAuth1AccessToken(const std::string& oauth1_access_token, | 94 virtual void VerifyOAuth1AccessToken(const std::string& oauth1_access_token, |
| 95 const std::string& oauth1_secret) = 0; | 95 const std::string& oauth1_secret) = 0; |
| 96 | 96 |
| 97 // OAuth token encryption helpers. | 97 // OAuth token encryption helpers. |
| 98 virtual std::string EncryptToken(const std::string& token) = 0; | 98 virtual std::string EncryptToken(const std::string& token) = 0; |
| 99 virtual std::string DecryptToken(const std::string& encrypted_token) = 0; | 99 virtual std::string DecryptToken(const std::string& encrypted_token) = 0; |
| 100 // TODO(zelidrag): Remove legacy encryption support in R16. | |
| 101 virtual std::string DecryptLegacyToken( | |
| 102 const std::string& encrypted_token) = 0; | |
| 103 | 100 |
| 104 // Profile (usually off the record ) that was used to perform the last | 101 // Profile (usually off the record ) that was used to perform the last |
| 105 // authentication process. | 102 // authentication process. |
| 106 Profile* authentication_profile() { return authentication_profile_; } | 103 Profile* authentication_profile() { return authentication_profile_; } |
| 107 | 104 |
| 108 // Perform basic canonicalization of |email_address|, taking into account | 105 // Perform basic canonicalization of |email_address|, taking into account |
| 109 // that gmail does not consider '.' or caps inside a username to matter. | 106 // that gmail does not consider '.' or caps inside a username to matter. |
| 110 // It also ignores everything after a '+'. | 107 // It also ignores everything after a '+'. |
| 111 // For example, c.masone+abc@gmail.com == cMaSone@gmail.com, per | 108 // For example, c.masone+abc@gmail.com == cMaSone@gmail.com, per |
| 112 // http://mail.google.com/support/bin/answer.py?hl=en&ctx=mail&answer=10313# | 109 // http://mail.google.com/support/bin/answer.py?hl=en&ctx=mail&answer=10313# |
| 113 static std::string Canonicalize(const std::string& email_address); | 110 static std::string Canonicalize(const std::string& email_address); |
| 114 | 111 |
| 115 protected: | 112 protected: |
| 116 LoginStatusConsumer* consumer_; | 113 LoginStatusConsumer* consumer_; |
| 117 Profile* authentication_profile_; | 114 Profile* authentication_profile_; |
| 118 | 115 |
| 119 private: | 116 private: |
| 120 DISALLOW_COPY_AND_ASSIGN(Authenticator); | 117 DISALLOW_COPY_AND_ASSIGN(Authenticator); |
| 121 }; | 118 }; |
| 122 | 119 |
| 123 } // namespace chromeos | 120 } // namespace chromeos |
| 124 | 121 |
| 125 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 122 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
| OLD | NEW |