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

Side by Side Diff: ash/metrics/user_metrics_recorder.cc

Issue 2421323002: Created new account type for ARC++ kiosk. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 | « ash/common/system/user/tray_user.cc ('k') | ash/system/chromeos/screen_layout_observer.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 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 "ash/metrics/user_metrics_recorder.h" 5 #include "ash/metrics/user_metrics_recorder.h"
6 6
7 #include "ash/common/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/shelf/shelf_delegate.h" 8 #include "ash/common/shelf/shelf_delegate.h"
9 #include "ash/common/shelf/shelf_item_types.h" 9 #include "ash/common/shelf/shelf_item_types.h"
10 #include "ash/common/shelf/shelf_model.h" 10 #include "ash/common/shelf/shelf_model.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 return active_window_state_type; 86 return active_window_state_type;
87 } 87 }
88 88
89 // Returns true if kiosk mode is active. 89 // Returns true if kiosk mode is active.
90 bool IsKioskModeActive() { 90 bool IsKioskModeActive() {
91 return WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() == 91 return WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() ==
92 LoginStatus::KIOSK_APP; 92 LoginStatus::KIOSK_APP;
93 } 93 }
94 94
95 // Returns true if ARC kiosk mode is active.
96 bool IsArcKioskModeActive() {
97 return WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() ==
98 LoginStatus::ARC_KIOSK_APP;
99 }
100
95 // Returns true if there is an active user and their session isn't currently 101 // Returns true if there is an active user and their session isn't currently
96 // locked. 102 // locked.
97 bool IsUserActive() { 103 bool IsUserActive() {
98 switch (WmShell::Get()->system_tray_delegate()->GetUserLoginStatus()) { 104 switch (WmShell::Get()->system_tray_delegate()->GetUserLoginStatus()) {
99 case LoginStatus::NOT_LOGGED_IN: 105 case LoginStatus::NOT_LOGGED_IN:
100 case LoginStatus::LOCKED: 106 case LoginStatus::LOCKED:
101 return false; 107 return false;
102 case LoginStatus::USER: 108 case LoginStatus::USER:
103 case LoginStatus::OWNER: 109 case LoginStatus::OWNER:
104 case LoginStatus::GUEST: 110 case LoginStatus::GUEST:
105 case LoginStatus::PUBLIC: 111 case LoginStatus::PUBLIC:
106 case LoginStatus::SUPERVISED: 112 case LoginStatus::SUPERVISED:
107 case LoginStatus::KIOSK_APP: 113 case LoginStatus::KIOSK_APP:
114 case LoginStatus::ARC_KIOSK_APP:
108 return true; 115 return true;
109 } 116 }
110 NOTREACHED(); 117 NOTREACHED();
111 return false; 118 return false;
112 } 119 }
113 120
114 // Array of window container ids that contain visible windows to be counted for 121 // Array of window container ids that contain visible windows to be counted for
115 // UMA statistics. Note the containers are ordered from top most visible 122 // UMA statistics. Note the containers are ordered from top most visible
116 // container to the lowest to allow the |GetNumVisibleWindows| method to short 123 // container to the lowest to allow the |GetNumVisibleWindows| method to short
117 // circuit when processing a maximized or fullscreen window. 124 // circuit when processing a maximized or fullscreen window.
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 // TODO(bruthig): Find out if this should only be logged when the user is 649 // TODO(bruthig): Find out if this should only be logged when the user is
643 // active. 650 // active.
644 // TODO(bruthig): Consider tracking how long a particular type of window is 651 // TODO(bruthig): Consider tracking how long a particular type of window is
645 // active at a time. 652 // active at a time.
646 UMA_HISTOGRAM_ENUMERATION("Ash.ActiveWindowShowTypeOverTime", 653 UMA_HISTOGRAM_ENUMERATION("Ash.ActiveWindowShowTypeOverTime",
647 GetActiveWindowState(), 654 GetActiveWindowState(),
648 ACTIVE_WINDOW_STATE_TYPE_COUNT); 655 ACTIVE_WINDOW_STATE_TYPE_COUNT);
649 } 656 }
650 657
651 bool UserMetricsRecorder::IsUserInActiveDesktopEnvironment() const { 658 bool UserMetricsRecorder::IsUserInActiveDesktopEnvironment() const {
652 return IsUserActive() && !IsKioskModeActive(); 659 return IsUserActive() && !IsKioskModeActive() && !IsArcKioskModeActive();
653 } 660 }
654 661
655 void UserMetricsRecorder::StartTimer() { 662 void UserMetricsRecorder::StartTimer() {
656 timer_.Start(FROM_HERE, 663 timer_.Start(FROM_HERE,
657 base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds), 664 base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds),
658 this, &UserMetricsRecorder::RecordPeriodicMetrics); 665 this, &UserMetricsRecorder::RecordPeriodicMetrics);
659 } 666 }
660 667
661 } // namespace ash 668 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/user/tray_user.cc ('k') | ash/system/chromeos/screen_layout_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698