| 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 COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_INTERNALS_UTIL_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_INTERNALS_UTIL_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_INTERNALS_UTIL_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_INTERNALS_UTIL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Returns the name of a SigninStatus field. | 62 // Returns the name of a SigninStatus field. |
| 63 std::string SigninStatusFieldToString(UntimedSigninStatusField field); | 63 std::string SigninStatusFieldToString(UntimedSigninStatusField field); |
| 64 std::string SigninStatusFieldToString(TimedSigninStatusField field); | 64 std::string SigninStatusFieldToString(TimedSigninStatusField field); |
| 65 | 65 |
| 66 // An Observer class for authentication and token diagnostic information. | 66 // An Observer class for authentication and token diagnostic information. |
| 67 class SigninDiagnosticsObserver { | 67 class SigninDiagnosticsObserver { |
| 68 public: | 68 public: |
| 69 // Credentials and signin related changes. | 69 // Credentials and signin related changes. |
| 70 virtual void NotifySigninValueChanged(const TimedSigninStatusField& field, | 70 virtual void NotifySigninValueChanged(const TimedSigninStatusField& field, |
| 71 const std::string& value) {} | 71 const std::string& value) {} |
| 72 // OAuth tokens related changes. | 72 }; |
| 73 virtual void NotifyTokenReceivedSuccess(const std::string& token_name, | |
| 74 const std::string& token, | |
| 75 bool update_time) {} | |
| 76 virtual void NotifyTokenReceivedFailure(const std::string& token_name, | |
| 77 const std::string& error) {} | |
| 78 virtual void NotifyClearStoredToken(const std::string& token_name) {}}; | |
| 79 | 73 |
| 80 // Gets the first 6 hex characters of the SHA256 hash of the passed in string. | 74 // Gets the first 6 hex characters of the SHA256 hash of the passed in string. |
| 81 // These are enough to perform equality checks across a single users tokens, | 75 // These are enough to perform equality checks across a single users tokens, |
| 82 // while preventing outsiders from reverse-engineering the actual token from | 76 // while preventing outsiders from reverse-engineering the actual token from |
| 83 // the displayed value. | 77 // the displayed value. |
| 84 // Note that for readability (in about:signin-internals), an empty string | 78 // Note that for readability (in about:signin-internals), an empty string |
| 85 // is not hashed, but simply returned as an empty string. | 79 // is not hashed, but simply returned as an empty string. |
| 86 std::string GetTruncatedHash(const std::string& str); | 80 std::string GetTruncatedHash(const std::string& str); |
| 87 | 81 |
| 88 } // namespace signin_internals_util | 82 } // namespace signin_internals_util |
| 89 | 83 |
| 90 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_INTERNALS_UTIL_H_ | 84 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_INTERNALS_UTIL_H_ |
| OLD | NEW |