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 #include "chrome/browser/metrics/signin_status_metrics_provider.h" | 5 #include "chrome/browser/metrics/signin_status_metrics_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
116 void SigninStatusMetricsProvider::SigninManagerShutdown( | 116 void SigninStatusMetricsProvider::SigninManagerShutdown( |
117 SigninManagerBase* manager) { | 117 SigninManagerBase* manager) { |
118 if (scoped_observer_.IsObserving(manager)) | 118 if (scoped_observer_.IsObserving(manager)) |
119 scoped_observer_.Remove(manager); | 119 scoped_observer_.Remove(manager); |
120 } | 120 } |
121 | 121 |
122 void SigninStatusMetricsProvider::GoogleSigninSucceeded( | 122 void SigninStatusMetricsProvider::GoogleSigninSucceeded( |
| 123 const std::string& account_id, |
123 const std::string& username, | 124 const std::string& username, |
124 const std::string& password) { | 125 const std::string& password) { |
125 if (signin_status_ == ALL_PROFILES_NOT_SIGNED_IN) | 126 if (signin_status_ == ALL_PROFILES_NOT_SIGNED_IN) |
126 signin_status_ = MIXED_SIGNIN_STATUS; | 127 signin_status_ = MIXED_SIGNIN_STATUS; |
127 } | 128 } |
128 | 129 |
129 void SigninStatusMetricsProvider::GoogleSignedOut(const std::string& username) { | 130 void SigninStatusMetricsProvider::GoogleSignedOut(const std::string& account_id, |
| 131 const std::string& username) { |
130 if (signin_status_ == ALL_PROFILES_SIGNED_IN) | 132 if (signin_status_ == ALL_PROFILES_SIGNED_IN) |
131 signin_status_ = MIXED_SIGNIN_STATUS; | 133 signin_status_ = MIXED_SIGNIN_STATUS; |
132 } | 134 } |
133 | 135 |
134 void SigninStatusMetricsProvider::Initialize() { | 136 void SigninStatusMetricsProvider::Initialize() { |
135 // Add observers. | 137 // Add observers. |
136 #if !defined(OS_ANDROID) | 138 #if !defined(OS_ANDROID) |
137 // On Android, there is always only one profile in any situation, opening new | 139 // On Android, there is always only one profile in any situation, opening new |
138 // windows (which is possible with only some Android devices) will not change | 140 // windows (which is possible with only some Android devices) will not change |
139 // the opened profiles signin status. | 141 // the opened profiles signin status. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 if (manager && manager->IsAuthenticated()) | 215 if (manager && manager->IsAuthenticated()) |
214 signed_in_profiles_count++; | 216 signed_in_profiles_count++; |
215 } | 217 } |
216 UpdateInitialSigninStatus(opened_profiles_count, signed_in_profiles_count); | 218 UpdateInitialSigninStatus(opened_profiles_count, signed_in_profiles_count); |
217 } | 219 } |
218 | 220 |
219 SigninStatusMetricsProvider::ProfilesSigninStatus | 221 SigninStatusMetricsProvider::ProfilesSigninStatus |
220 SigninStatusMetricsProvider::GetSigninStatusForTesting() { | 222 SigninStatusMetricsProvider::GetSigninStatusForTesting() { |
221 return signin_status_; | 223 return signin_status_; |
222 } | 224 } |
OLD | NEW |