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

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

Issue 7105018: UMA metrics for cloud policies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed detection of some events, rebased Created 9 years, 6 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
Index: chrome/browser/chromeos/login/enterprise_enrollment_screen.cc
diff --git a/chrome/browser/chromeos/login/enterprise_enrollment_screen.cc b/chrome/browser/chromeos/login/enterprise_enrollment_screen.cc
index 102554ef2a0784f022c4ae200f5622ed69c121e9..506b12c842a1e2dc63fb716f5a75cfc7434d3b1f 100644
--- a/chrome/browser/chromeos/login/enterprise_enrollment_screen.cc
+++ b/chrome/browser/chromeos/login/enterprise_enrollment_screen.cc
@@ -10,10 +10,13 @@
#include "chrome/browser/chromeos/cros/cryptohome_library.h"
#include "chrome/browser/chromeos/login/screen_observer.h"
#include "chrome/browser/policy/browser_policy_connector.h"
+#include "chrome/browser/policy/enterprise_metrics.h"
#include "chrome/common/net/gaia/gaia_constants.h"
namespace chromeos {
+namespace em = enterprise_management;
+
// Retry for InstallAttrs initialization every 500ms.
const int kLockRetryIntervalMs = 500;
@@ -40,6 +43,7 @@ void EnterpriseEnrollmentScreen::Authenticate(const std::string& user,
const std::string& password,
const std::string& captcha,
const std::string& access_code) {
+ em::LogEnrollmentOperation(em::kEnrollmentStarted);
captcha_token_.clear();
user_ = user;
auth_fetcher_.reset(
@@ -60,6 +64,7 @@ void EnterpriseEnrollmentScreen::Authenticate(const std::string& user,
}
void EnterpriseEnrollmentScreen::CancelEnrollment() {
+ em::LogEnrollmentOperation(em::kEnrollmentCancelled);
auth_fetcher_.reset();
registrar_.reset();
g_browser_process->browser_policy_connector()->StopAutoRetry();
@@ -113,6 +118,7 @@ void EnterpriseEnrollmentScreen::OnIssueAuthTokenSuccess(
const std::string& service,
const std::string& auth_token) {
if (service != GaiaConstants::kDeviceManagementService) {
+ em::LogEnrollmentOperation(em::kEnrollmentOtherFailed);
NOTREACHED() << service;
return;
}
@@ -123,6 +129,7 @@ void EnterpriseEnrollmentScreen::OnIssueAuthTokenSuccess(
g_browser_process->browser_policy_connector();
if (!connector->cloud_policy_subsystem()) {
NOTREACHED() << "Cloud policy subsystem not initialized.";
+ em::LogEnrollmentOperation(em::kEnrollmentOtherFailed);
if (view())
view()->ShowFatalEnrollmentError();
return;
@@ -142,6 +149,7 @@ void EnterpriseEnrollmentScreen::OnIssueAuthTokenFailure(
const GoogleServiceAuthError& error) {
if (service != GaiaConstants::kDeviceManagementService) {
NOTREACHED() << service;
+ em::LogEnrollmentOperation(em::kEnrollmentOtherFailed);
return;
}
@@ -173,11 +181,17 @@ void EnterpriseEnrollmentScreen::OnPolicyStateChanged(
case policy::CloudPolicySubsystem::SUCCESS:
// Success!
registrar_.reset();
+ em::LogEnrollmentOperation(em::kEnrollmentOK);
view()->ShowConfirmationScreen();
return;
}
// We have an error.
+ if (state == policy::CloudPolicySubsystem::UNMANAGED) {
+ em::LogEnrollmentOperation(em::kEnrollmentNotSupported);
+ } else {
+ em::LogEnrollmentOperation(em::kEnrollmentPolicyFailed);
+ }
LOG(WARNING) << "Policy subsystem error during enrollment: " << state
<< " details: " << error_details;
}
@@ -199,16 +213,21 @@ void EnterpriseEnrollmentScreen::HandleAuthError(
return;
switch (error.state()) {
- case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS:
case GoogleServiceAuthError::CONNECTION_FAILED:
+ em::LogEnrollmentOperation(em::kEnrollmentNetworkFailed);
+ view()->ShowNetworkEnrollmentError();
+ return;
+ case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS:
case GoogleServiceAuthError::CAPTCHA_REQUIRED:
case GoogleServiceAuthError::TWO_FACTOR:
+ em::LogEnrollmentOperation(em::kEnrollmentLoginFailed);
view()->ShowAuthError(error);
return;
case GoogleServiceAuthError::USER_NOT_SIGNED_UP:
case GoogleServiceAuthError::ACCOUNT_DELETED:
case GoogleServiceAuthError::ACCOUNT_DISABLED:
case GoogleServiceAuthError::SERVICE_UNAVAILABLE:
kmixter1 2011/06/28 01:06:02 is SERVICE_UNAVAILABLE a network/service transient
Joao da Silva 2011/06/30 12:57:00 It's an error that can be returned from gaia, and
kmixter1 2011/06/30 23:28:59 Agree - from your description it sounds like it is
+ em::LogEnrollmentOperation(em::kEnrollmentNotSupported);
view()->ShowAccountError();
return;
case GoogleServiceAuthError::NONE:
@@ -217,11 +236,13 @@ void EnterpriseEnrollmentScreen::HandleAuthError(
// fall through.
case GoogleServiceAuthError::REQUEST_CANCELED:
LOG(ERROR) << "Unexpected GAIA auth error: " << error.state();
+ em::LogEnrollmentOperation(em::kEnrollmentNetworkFailed);
view()->ShowFatalAuthError();
return;
}
NOTREACHED() << error.state();
+ em::LogEnrollmentOperation(em::kEnrollmentOtherFailed);
}
void EnterpriseEnrollmentScreen::WriteInstallAttributesData() {
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/wizard_controller.cc » ('j') | chrome/browser/chromeos/login/wizard_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698