Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Side by Side Diff: components/signin/core/browser/signin_internals_util.h

Issue 2672833002: [Desktop] Add diagnostics about loading the refresh tokens. (Closed)
Patch Set: Fix compile Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « components/signin/core/browser/about_signin_internals.cc ('k') | components/signin/core/browser/webdata/token_service_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698