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

Side by Side Diff: chrome/browser/chromeos/kiosk_mode/kiosk_mode_metrics.cc

Issue 10825257: Remove metrics collection from Kiosk Mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_metrics.h"
6
7 #include "base/metrics/histogram.h"
8
9 namespace {
10
11 const char kDemoUserSessionTimeMetric[] = "KioskMode.DemoUserSessionTime";
12 const char kDemoUserAppsLaunchedMetric[] = "KioskMode.DemoUserAppsLaunched";
13
14 }
15
16 namespace chromeos {
17
18 static KioskModeMetrics* kiosk_mode_settings = NULL;
19
20 // static
21 KioskModeMetrics* KioskModeMetrics::Get() {
22 if (!kiosk_mode_settings)
23 kiosk_mode_settings = new KioskModeMetrics();
24
25 return kiosk_mode_settings;
26 }
27
28 void KioskModeMetrics::SessionStarted() {
29 session_started_ = base::Time::Now();
30 }
31
32 void KioskModeMetrics::SessionEnded() {
33 if (session_started_ == base::Time())
34 return;
35
36 // Session ended, time to report our collected metrics.
37 UMA_HISTOGRAM_LONG_TIMES(kDemoUserSessionTimeMetric,
38 base::Time::Now() - session_started_);
39
40 UMA_HISTOGRAM_COUNTS(kDemoUserAppsLaunchedMetric, apps_opened_);
41
42 // We've consumed the session times, reset.
43 session_started_ = base::Time();
44 }
45
46 void KioskModeMetrics::UserOpenedApp() {
47 if (session_started_ == base::Time())
48 return;
49 ++apps_opened_;
50 }
51
52 KioskModeMetrics::KioskModeMetrics()
53 : session_started_(base::Time()),
54 apps_opened_(0) {
55 }
56
57 KioskModeMetrics::~KioskModeMetrics() {
58 }
59
60 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/kiosk_mode/kiosk_mode_metrics.h ('k') | chrome/browser/chromeos/login/login_performer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698