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

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

Issue 1765273002: kiosk: Add kiosk launch type UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/app_launch_controller.cc
diff --git a/chrome/browser/chromeos/login/app_launch_controller.cc b/chrome/browser/chromeos/login/app_launch_controller.cc
index c8c65796cf403e2493557c6ac4acacac30168cd4..effafddd44613c50c852960e9655ee5366cd4e03 100644
--- a/chrome/browser/chromeos/login/app_launch_controller.cc
+++ b/chrome/browser/chromeos/login/app_launch_controller.cc
@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/histogram.h"
Ilya Sherman 2016/03/05 00:30:26 nit: Please include histogram_macros instead
xiyuan 2016/03/07 15:41:21 Done.
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -40,9 +41,38 @@ namespace chromeos {
namespace {
+// Enum types for Kiosk.LaunchType UMA so don't change its values.
+// KioskLaunchType in histogram.xml must be updated when making changes here.
+enum KioskLaunchType {
+ KIOSK_LAUNCH_ENTERPRISE_AUTO_LAUNCH = 0,
+ KIOKS_LAUNCH_ENTERPRISE_MANUAL_LAUNCH = 1,
+ KIOSK_LAUNCH_CONSUMER_AUTO_LAUNCH = 2,
+ KIOSK_LAUNCH_CONSUMER_MANUAL_LAUNCH = 3,
+
+ KIOSK_LAUNCH_TYPE_MAX // This must be the last entry.
Ilya Sherman 2016/03/05 00:30:26 nit: s/MAX/COUNT
xiyuan 2016/03/07 15:41:21 Done.
+};
+
// Application install splash screen minimum show time in milliseconds.
const int kAppInstallSplashScreenMinTimeMS = 3000;
+bool IsEnterpriseManaged() {
+ policy::BrowserPolicyConnectorChromeOS* connector =
+ g_browser_process->platform_part()->browser_policy_connector_chromeos();
+ return connector->IsEnterpriseManaged();
+}
+
+void RecordKioskLaunchUMA(bool is_auto_launch) {
+ const KioskLaunchType launch_type =
+ IsEnterpriseManaged()
+ ? (is_auto_launch ? KIOSK_LAUNCH_ENTERPRISE_AUTO_LAUNCH
+ : KIOKS_LAUNCH_ENTERPRISE_MANUAL_LAUNCH)
+ : (is_auto_launch ? KIOSK_LAUNCH_CONSUMER_AUTO_LAUNCH
+ : KIOSK_LAUNCH_CONSUMER_MANUAL_LAUNCH);
+
+ UMA_HISTOGRAM_ENUMERATION("Kiosk.LaunchType", launch_type,
+ KIOSK_LAUNCH_TYPE_MAX);
+}
+
} // namespace
// static
@@ -130,6 +160,8 @@ AppLaunchController::~AppLaunchController() {
void AppLaunchController::StartAppLaunch(bool is_auto_launch) {
DVLOG(1) << "Starting kiosk mode...";
+ RecordKioskLaunchUMA(is_auto_launch);
+
// Ensure WebUILoginView is enabled so that bailout shortcut key works.
host_->GetWebUILoginView()->SetUIEnabled(true);
@@ -308,9 +340,7 @@ bool AppLaunchController::CanConfigureNetwork() {
if (can_configure_network_callback_)
return can_configure_network_callback_->Run();
- policy::BrowserPolicyConnectorChromeOS* connector =
- g_browser_process->platform_part()->browser_policy_connector_chromeos();
- if (connector->IsEnterpriseManaged()) {
+ if (IsEnterpriseManaged()) {
bool should_prompt;
if (CrosSettings::Get()->GetBoolean(
kAccountsPrefDeviceLocalAccountPromptForNetworkWhenOffline,
@@ -329,9 +359,7 @@ bool AppLaunchController::NeedOwnerAuthToConfigureNetwork() {
if (need_owner_auth_to_configure_network_callback_)
return need_owner_auth_to_configure_network_callback_->Run();
- policy::BrowserPolicyConnectorChromeOS* connector =
- g_browser_process->platform_part()->browser_policy_connector_chromeos();
- return !connector->IsEnterpriseManaged();
+ return !IsEnterpriseManaged();
}
void AppLaunchController::MaybeShowNetworkConfigureUI() {
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698