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

Side by Side Diff: chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.cc

Issue 494633003: UMA: How often are different network error screens encountered during OOBE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 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
OLDNEW
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/chromeos/login/enrollment/auto_enrollment_check_screen. h" 5 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen. h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h"
11 #include "chrome/browser/chromeos/login/screens/screen_observer.h" 12 #include "chrome/browser/chromeos/login/screens/screen_observer.h"
12 #include "chrome/browser/chromeos/login/wizard_controller.h" 13 #include "chrome/browser/chromeos/login/wizard_controller.h"
13 #include "chromeos/chromeos_switches.h" 14 #include "chromeos/chromeos_switches.h"
14 #include "chromeos/network/network_state.h" 15 #include "chromeos/network/network_state.h"
15 #include "chromeos/network/network_state_handler.h" 16 #include "chromeos/network/network_state_handler.h"
16 17
17 namespace chromeos { 18 namespace chromeos {
18 19
19 AutoEnrollmentCheckScreen::AutoEnrollmentCheckScreen( 20 AutoEnrollmentCheckScreen::AutoEnrollmentCheckScreen(
20 ScreenObserver* observer, 21 ScreenObserver* observer,
21 AutoEnrollmentCheckScreenActor* actor) 22 AutoEnrollmentCheckScreenActor* actor)
22 : WizardScreen(observer), 23 : WizardScreen(observer),
23 actor_(actor), 24 actor_(actor),
24 captive_portal_status_( 25 captive_portal_status_(
25 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN), 26 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN),
26 auto_enrollment_state_(policy::AUTO_ENROLLMENT_STATE_IDLE) { 27 auto_enrollment_state_(policy::AUTO_ENROLLMENT_STATE_IDLE),
28 histogram_helper_(new ErrorScreensHistogramHelper("Enrollment")) {
27 if (actor_) 29 if (actor_)
28 actor_->SetDelegate(this); 30 actor_->SetDelegate(this);
29 } 31 }
30 32
31 AutoEnrollmentCheckScreen::~AutoEnrollmentCheckScreen() { 33 AutoEnrollmentCheckScreen::~AutoEnrollmentCheckScreen() {
32 NetworkPortalDetector::Get()->RemoveObserver(this); 34 NetworkPortalDetector::Get()->RemoveObserver(this);
33 if (actor_) 35 if (actor_)
34 actor_->SetDelegate(NULL); 36 actor_->SetDelegate(NULL);
35 } 37 }
36 38
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 72 }
71 73
72 void AutoEnrollmentCheckScreen::PrepareToShow() { 74 void AutoEnrollmentCheckScreen::PrepareToShow() {
73 } 75 }
74 76
75 void AutoEnrollmentCheckScreen::Show() { 77 void AutoEnrollmentCheckScreen::Show() {
76 if (IsStartNeeded()) { 78 if (IsStartNeeded()) {
77 Start(); 79 Start();
78 if (actor_) 80 if (actor_)
79 actor_->Show(); 81 actor_->Show();
82 histogram_helper_->OnScreenShow();
80 } 83 }
81 } 84 }
82 85
83 void AutoEnrollmentCheckScreen::Hide() { 86 void AutoEnrollmentCheckScreen::Hide() {
84 } 87 }
85 88
86 std::string AutoEnrollmentCheckScreen::GetName() const { 89 std::string AutoEnrollmentCheckScreen::GetName() const {
87 return WizardController::kAutoEnrollmentCheckScreenName; 90 return WizardController::kAutoEnrollmentCheckScreenName;
88 } 91 }
89 92
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 void AutoEnrollmentCheckScreen::ShowErrorScreen( 207 void AutoEnrollmentCheckScreen::ShowErrorScreen(
205 ErrorScreen::ErrorState error_state) { 208 ErrorScreen::ErrorState error_state) {
206 const NetworkState* network = 209 const NetworkState* network =
207 NetworkHandler::Get()->network_state_handler()->DefaultNetwork(); 210 NetworkHandler::Get()->network_state_handler()->DefaultNetwork();
208 ErrorScreen* error_screen = get_screen_observer()->GetErrorScreen(); 211 ErrorScreen* error_screen = get_screen_observer()->GetErrorScreen();
209 error_screen->SetUIState(ErrorScreen::UI_STATE_AUTO_ENROLLMENT_ERROR); 212 error_screen->SetUIState(ErrorScreen::UI_STATE_AUTO_ENROLLMENT_ERROR);
210 error_screen->AllowGuestSignin(true); 213 error_screen->AllowGuestSignin(true);
211 error_screen->SetErrorState(error_state, 214 error_screen->SetErrorState(error_state,
212 network ? network->name() : std::string()); 215 network ? network->name() : std::string());
213 get_screen_observer()->ShowErrorScreen(); 216 get_screen_observer()->ShowErrorScreen();
217 histogram_helper_->OnErrorShow(error_screen->GetErrorState());
ygorshenin1 2014/08/26 14:33:13 nit: I suggest you to replace ErrorScreen::GetErro
Roman Sorokin (ftl) 2014/09/04 13:26:47 Done.
214 } 218 }
215 219
216 void AutoEnrollmentCheckScreen::SignalCompletion() { 220 void AutoEnrollmentCheckScreen::SignalCompletion() {
217 NetworkPortalDetector::Get()->RemoveObserver(this); 221 NetworkPortalDetector::Get()->RemoveObserver(this);
218 auto_enrollment_progress_subscription_.reset(); 222 auto_enrollment_progress_subscription_.reset();
219 get_screen_observer()->OnExit( 223 get_screen_observer()->OnExit(
220 ScreenObserver::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED); 224 ScreenObserver::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED);
221 } 225 }
222 226
223 } // namespace chromeos 227 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698