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

Side by Side Diff: chrome/browser/chromeos/login/app_launch_controller.cc

Issue 2692163003: cros: Add enterprise user session metrics (Closed)
Patch Set: update sparse histogram comment Created 3 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/app_launch_controller.h" 5 #include "chrome/browser/chromeos/login/app_launch_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/metrics/histogram_macros.h" 15 #include "base/metrics/histogram_macros.h"
16 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
17 #include "base/threading/thread_task_runner_handle.h" 17 #include "base/threading/thread_task_runner_handle.h"
18 #include "base/time/time.h" 18 #include "base/time/time.h"
19 #include "base/values.h" 19 #include "base/values.h"
20 #include "chrome/browser/browser_process.h" 20 #include "chrome/browser/browser_process.h"
21 #include "chrome/browser/chrome_notification_types.h" 21 #include "chrome/browser/chrome_notification_types.h"
22 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 22 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
23 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" 23 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h"
24 #include "chrome/browser/chromeos/login/enterprise_user_session_metrics.h"
24 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 25 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
25 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 26 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
26 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 27 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
27 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 28 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
28 #include "chrome/browser/chromeos/settings/cros_settings.h" 29 #include "chrome/browser/chromeos/settings/cros_settings.h"
29 #include "chrome/browser/lifetime/application_lifetime.h" 30 #include "chrome/browser/lifetime/application_lifetime.h"
30 #include "chrome/browser/profiles/profile.h" 31 #include "chrome/browser/profiles/profile.h"
31 #include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handle r.h" 32 #include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handle r.h"
32 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 33 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
33 #include "chromeos/settings/cros_settings_names.h" 34 #include "chromeos/settings/cros_settings_names.h"
(...skipping 17 matching lines...) Expand all
51 KIOSK_LAUNCH_CONSUMER_AUTO_LAUNCH = 2, 52 KIOSK_LAUNCH_CONSUMER_AUTO_LAUNCH = 2,
52 KIOSK_LAUNCH_CONSUMER_MANUAL_LAUNCH = 3, 53 KIOSK_LAUNCH_CONSUMER_MANUAL_LAUNCH = 3,
53 54
54 KIOSK_LAUNCH_TYPE_COUNT // This must be the last entry. 55 KIOSK_LAUNCH_TYPE_COUNT // This must be the last entry.
55 }; 56 };
56 57
57 // Application install splash screen minimum show time in milliseconds. 58 // Application install splash screen minimum show time in milliseconds.
58 const int kAppInstallSplashScreenMinTimeMS = 3000; 59 const int kAppInstallSplashScreenMinTimeMS = 3000;
59 60
60 bool IsEnterpriseManaged() { 61 bool IsEnterpriseManaged() {
61 policy::BrowserPolicyConnectorChromeOS* connector = 62 return g_browser_process->platform_part()
62 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 63 ->browser_policy_connector_chromeos()
63 return connector->IsEnterpriseManaged(); 64 ->IsEnterpriseManaged();
64 } 65 }
65 66
66 void RecordKioskLaunchUMA(bool is_auto_launch) { 67 void RecordKioskLaunchUMA(bool is_auto_launch) {
67 const KioskLaunchType launch_type = 68 const KioskLaunchType launch_type =
68 IsEnterpriseManaged() 69 IsEnterpriseManaged()
69 ? (is_auto_launch ? KIOSK_LAUNCH_ENTERPRISE_AUTO_LAUNCH 70 ? (is_auto_launch ? KIOSK_LAUNCH_ENTERPRISE_AUTO_LAUNCH
70 : KIOKS_LAUNCH_ENTERPRISE_MANUAL_LAUNCH) 71 : KIOKS_LAUNCH_ENTERPRISE_MANUAL_LAUNCH)
71 : (is_auto_launch ? KIOSK_LAUNCH_CONSUMER_AUTO_LAUNCH 72 : (is_auto_launch ? KIOSK_LAUNCH_CONSUMER_AUTO_LAUNCH
72 : KIOSK_LAUNCH_CONSUMER_MANUAL_LAUNCH); 73 : KIOSK_LAUNCH_CONSUMER_MANUAL_LAUNCH);
73 74
74 UMA_HISTOGRAM_ENUMERATION("Kiosk.LaunchType", launch_type, 75 UMA_HISTOGRAM_ENUMERATION("Kiosk.LaunchType", launch_type,
75 KIOSK_LAUNCH_TYPE_COUNT); 76 KIOSK_LAUNCH_TYPE_COUNT);
77
78 if (IsEnterpriseManaged()) {
79 enterprise_user_session_metrics::RecordSignInEvent(
80 is_auto_launch
81 ? enterprise_user_session_metrics::SignInEventType::AUTOMATIC_KIOSK
82 : enterprise_user_session_metrics::SignInEventType::MANUAL_KIOSK);
83 }
76 } 84 }
77 85
78 } // namespace 86 } // namespace
79 87
80 // static 88 // static
81 bool AppLaunchController::skip_splash_wait_ = false; 89 bool AppLaunchController::skip_splash_wait_ = false;
82 int AppLaunchController::network_wait_time_ = 10; 90 int AppLaunchController::network_wait_time_ = 10;
83 base::Closure* AppLaunchController::network_timeout_callback_ = NULL; 91 base::Closure* AppLaunchController::network_timeout_callback_ = NULL;
84 AppLaunchController::ReturnBoolCallback* 92 AppLaunchController::ReturnBoolCallback*
85 AppLaunchController::can_configure_network_callback_ = NULL; 93 AppLaunchController::can_configure_network_callback_ = NULL;
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 KioskAppLaunchError::Save(error); 512 KioskAppLaunchError::Save(error);
505 chrome::AttemptUserExit(); 513 chrome::AttemptUserExit();
506 CleanUp(); 514 CleanUp();
507 } 515 }
508 516
509 bool AppLaunchController::IsShowingNetworkConfigScreen() { 517 bool AppLaunchController::IsShowingNetworkConfigScreen() {
510 return network_config_requested_; 518 return network_config_requested_;
511 } 519 }
512 520
513 } // namespace chromeos 521 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/login/enterprise_user_session_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698