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

Unified Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 2798343003: Merge "cros: Fix flaky owner detection" (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/users/chrome_user_manager_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/existing_user_controller.cc
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index 55e09eb3f5f34dab6df1c0e80d301a6e00c0c319..0915cb2a638083668683167187d3cd40b45a9447 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -728,6 +728,17 @@ void ExistingUserController::OnAuthSuccess(const UserContext& user_context) {
UMA_HISTOGRAM_COUNTS_100("Login.OfflineSuccess.Attempts",
num_login_attempts_);
+ const bool is_enterprise_managed = g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->IsEnterpriseManaged();
+
+ // Mark device will be consumer owned if the device is not managed and this is
+ // the first user on the device.
+ if (!is_enterprise_managed &&
+ user_manager::UserManager::Get()->GetUsers().empty()) {
+ DeviceSettingsService::Get()->MarkWillEstablishConsumerOwnership();
+ }
+
UserSessionManager::StartSessionType start_session_type =
UserAddingScreen::Get()->IsRunning()
? UserSessionManager::SECONDARY_USER_SESSION
@@ -750,9 +761,7 @@ void ExistingUserController::OnAuthSuccess(const UserContext& user_context) {
}
ClearRecordedNames();
- if (g_browser_process->platform_part()
- ->browser_policy_connector_chromeos()
- ->IsEnterpriseManaged()) {
+ if (is_enterprise_managed) {
enterprise_user_session_metrics::RecordSignInEvent(
user_context, last_login_attempt_was_auto_login_);
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/users/chrome_user_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698