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

Side by Side Diff: chrome/browser/chromeos/login/enrollment/enrollment_screen.h

Issue 385983007: Enrollment recovery: Add UMA stats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UMA_HISTOGRAM_ENUMERATION() call. Created 6 years, 5 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 | chrome/browser/chromeos/login/enrollment/enrollment_screen.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen_actor.h" 14 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen_actor.h"
15 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" 15 #include "chrome/browser/chromeos/login/screens/wizard_screen.h"
16 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 16 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
17 #include "components/policy/core/common/cloud/enterprise_metrics.h"
17 18
18 namespace chromeos { 19 namespace chromeos {
19 20
20 class ScreenObserver; 21 class ScreenObserver;
21 22
22 // The screen implementation that links the enterprise enrollment UI into the 23 // The screen implementation that links the enterprise enrollment UI into the
23 // OOBE wizard. 24 // OOBE wizard.
24 class EnrollmentScreen 25 class EnrollmentScreen
25 : public WizardScreen, 26 : public WizardScreen,
26 public EnrollmentScreenActor::Controller { 27 public EnrollmentScreenActor::Controller {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void RegisterForDevicePolicy(const std::string& token); 63 void RegisterForDevicePolicy(const std::string& token);
63 64
64 // Handles enrollment completion. Logs a UMA sample and requests the actor to 65 // Handles enrollment completion. Logs a UMA sample and requests the actor to
65 // show the specified enrollment status. 66 // show the specified enrollment status.
66 void ReportEnrollmentStatus(policy::EnrollmentStatus status); 67 void ReportEnrollmentStatus(policy::EnrollmentStatus status);
67 68
68 // Shows successful enrollment status after all enrollment related file 69 // Shows successful enrollment status after all enrollment related file
69 // operations are completed. 70 // operations are completed.
70 void ShowEnrollmentStatusOnSuccess(const policy::EnrollmentStatus& status); 71 void ShowEnrollmentStatusOnSuccess(const policy::EnrollmentStatus& status);
71 72
72 // Logs a UMA event in the kMetricEnrollment histogram. If auto-enrollment is 73 // Logs an UMA event in the kMetricEnrollment or the kMetricEnrollmentRecovery
73 // on |sample| is ignored and a kMetricEnrollmentAutoFailed sample is logged 74 // histogram, depending on |enrollment_mode_|.
75 void UMA(policy::MetricEnrollment sample);
76
77 // Logs an UMA event in the kMetricEnrollment or the kMetricEnrollmentRecovery
78 // histogram, depending on |enrollment_mode_|. If auto-enrollment is on,
79 // |sample| is ignored and a kMetricEnrollmentAutoFailed sample is logged
74 // instead. 80 // instead.
75 void UMAFailure(int sample); 81 void UMAFailure(policy::MetricEnrollment sample);
76 82
77 // Shows the signin screen. Used as a callback to run after auth reset. 83 // Shows the signin screen. Used as a callback to run after auth reset.
78 void ShowSigninScreen(); 84 void ShowSigninScreen();
79 85
80 // Convenience helper to check for auto enrollment mode. 86 // Convenience helper to check for auto enrollment mode.
81 bool is_auto_enrollment() const { 87 bool is_auto_enrollment() const {
82 return enrollment_mode_ == EnrollmentScreenActor::ENROLLMENT_MODE_AUTO; 88 return enrollment_mode_ == EnrollmentScreenActor::ENROLLMENT_MODE_AUTO;
83 } 89 }
84 90
85 EnrollmentScreenActor* actor_; 91 EnrollmentScreenActor* actor_;
86 EnrollmentScreenActor::EnrollmentMode enrollment_mode_; 92 EnrollmentScreenActor::EnrollmentMode enrollment_mode_;
87 bool enrollment_failed_once_; 93 bool enrollment_failed_once_;
88 std::string user_; 94 std::string user_;
89 int lockbox_init_duration_; 95 int lockbox_init_duration_;
90 base::WeakPtrFactory<EnrollmentScreen> weak_ptr_factory_; 96 base::WeakPtrFactory<EnrollmentScreen> weak_ptr_factory_;
91 97
92 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreen); 98 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreen);
93 }; 99 };
94 100
95 } // namespace chromeos 101 } // namespace chromeos
96 102
97 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ 103 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/enrollment/enrollment_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698