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

Side by Side Diff: chromeos/login/auth/auth_status_consumer.h

Issue 2842083002: Report Login.SuccessReason in LoginPerformer (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | chromeos/login/auth/login_performer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CHROMEOS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_ 5 #ifndef CHROMEOS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_
6 #define CHROMEOS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_ 6 #define CHROMEOS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 const FailureReason& reason() const { return reason_; } 98 const FailureReason& reason() const { return reason_; }
99 99
100 private: 100 private:
101 AuthFailure(FailureReason reason, GoogleServiceAuthError error) 101 AuthFailure(FailureReason reason, GoogleServiceAuthError error)
102 : reason_(reason), error_(error) {} 102 : reason_(reason), error_(error) {}
103 103
104 FailureReason reason_; 104 FailureReason reason_;
105 GoogleServiceAuthError error_; 105 GoogleServiceAuthError error_;
106 }; 106 };
107 107
108 // Enum used for UMA. Do NOT reorder or remove entry. Don't forget to
109 // update histograms.xml when adding new entries.
110 enum SuccessReason {
111 OFFLINE_AND_ONLINE = 0,
112 OFFLINE_ONLY = 1,
113 NUM_SUCCESS_REASONS, // This has to be the last item.
114 };
115
108 // An interface that defines the callbacks for objects that the 116 // An interface that defines the callbacks for objects that the
109 // Authenticator class will call to report the success/failure of 117 // Authenticator class will call to report the success/failure of
110 // authentication for Chromium OS. 118 // authentication for Chromium OS.
111 class CHROMEOS_EXPORT AuthStatusConsumer { 119 class CHROMEOS_EXPORT AuthStatusConsumer {
112 public: 120 public:
113 virtual ~AuthStatusConsumer() {} 121 virtual ~AuthStatusConsumer() {}
114 // The current login attempt has ended in failure, with error |error|. 122 // The current login attempt has ended in failure, with error |error|.
115 virtual void OnAuthFailure(const AuthFailure& error) = 0; 123 virtual void OnAuthFailure(const AuthFailure& error) = 0;
116 124
117 // The current login attempt has succeeded for |user_context|. 125 // The current login attempt has succeeded for |user_context|.
118 virtual void OnAuthSuccess(const UserContext& user_context) = 0; 126 virtual void OnAuthSuccess(const UserContext& user_context) = 0;
119 // The current guest login attempt has succeeded. 127 // The current guest login attempt has succeeded.
120 virtual void OnOffTheRecordAuthSuccess() {} 128 virtual void OnOffTheRecordAuthSuccess() {}
121 // The same password didn't work both online and offline. 129 // The same password didn't work both online and offline.
122 virtual void OnPasswordChangeDetected(); 130 virtual void OnPasswordChangeDetected();
123 // The cryptohome is encrypted in old format and needs migration. 131 // The cryptohome is encrypted in old format and needs migration.
124 virtual void OnOldEncryptionDetected(const UserContext& user_context, 132 virtual void OnOldEncryptionDetected(const UserContext& user_context,
125 bool has_incomplete_migration); 133 bool has_incomplete_migration);
126 }; 134 };
127 135
128 } // namespace chromeos 136 } // namespace chromeos
129 137
130 #endif // CHROMEOS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_ 138 #endif // CHROMEOS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_
OLDNEW
« no previous file with comments | « no previous file | chromeos/login/auth/login_performer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698