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 "chromeos/login/auth/login_performer.h" | 5 #include "chromeos/login/auth/login_performer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } else { | 72 } else { |
73 // COULD_NOT_MOUNT_CRYPTOHOME, COULD_NOT_MOUNT_TMPFS: | 73 // COULD_NOT_MOUNT_CRYPTOHOME, COULD_NOT_MOUNT_TMPFS: |
74 // happens during offline auth only. | 74 // happens during offline auth only. |
75 NOTREACHED(); | 75 NOTREACHED(); |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 void LoginPerformer::OnAuthSuccess(const UserContext& user_context) { | 79 void LoginPerformer::OnAuthSuccess(const UserContext& user_context) { |
80 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 80 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
81 base::RecordAction(UserMetricsAction("Login_Success")); | 81 base::RecordAction(UserMetricsAction("Login_Success")); |
| 82 |
| 83 // Do not distinguish between offline and online success. |
| 84 UMA_HISTOGRAM_ENUMERATION("Login.SuccessReason", OFFLINE_AND_ONLINE, |
| 85 NUM_SUCCESS_REASONS); |
| 86 |
82 VLOG(1) << "LoginSuccess hash: " << user_context.GetUserIDHash(); | 87 VLOG(1) << "LoginSuccess hash: " << user_context.GetUserIDHash(); |
83 DCHECK(delegate_); | 88 DCHECK(delegate_); |
84 // After delegate_->OnAuthSuccess(...) is called, delegate_ releases | 89 // After delegate_->OnAuthSuccess(...) is called, delegate_ releases |
85 // LoginPerformer ownership. LP now manages it's lifetime on its own. | 90 // LoginPerformer ownership. LP now manages it's lifetime on its own. |
86 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); | 91 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
87 delegate_->OnAuthSuccess(user_context); | 92 delegate_->OnAuthSuccess(user_context); |
88 } | 93 } |
89 | 94 |
90 void LoginPerformer::OnOffTheRecordAuthSuccess() { | 95 void LoginPerformer::OnOffTheRecordAuthSuccess() { |
91 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 96 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } else { | 311 } else { |
307 NOTREACHED(); | 312 NOTREACHED(); |
308 } | 313 } |
309 user_context_.ClearSecrets(); | 314 user_context_.ClearSecrets(); |
310 } | 315 } |
311 | 316 |
312 void LoginPerformer::EnsureAuthenticator() { | 317 void LoginPerformer::EnsureAuthenticator() { |
313 authenticator_ = CreateAuthenticator(); | 318 authenticator_ = CreateAuthenticator(); |
314 } | 319 } |
315 } // namespace chromeos | 320 } // namespace chromeos |
OLD | NEW |