Index: chrome/browser/chromeos/policy/status_uploader.cc |
diff --git a/chrome/browser/chromeos/policy/status_uploader.cc b/chrome/browser/chromeos/policy/status_uploader.cc |
index 83f7cc9740d22ee25100f49a9e849320fbdb4c0b..c5feb37b45278b62e9dc82845b6be67b82e3d54e 100644 |
--- a/chrome/browser/chromeos/policy/status_uploader.cc |
+++ b/chrome/browser/chromeos/policy/status_uploader.cc |
@@ -122,15 +122,30 @@ bool StatusUploader::IsSessionDataUploadAllowed() { |
// Check if we're in an auto-launched kiosk session. |
std::unique_ptr<DeviceLocalAccount> account = |
collector_->GetAutoLaunchedKioskSessionInfo(); |
- if (!account) |
+ if (!account) { |
+ LOG(WARNING) << "Not a kiosk session, data upload is not allowed."; |
return false; |
+ } |
// Check if there has been any user input. |
- if (!ui::UserActivityDetector::Get()->last_activity_time().is_null()) |
+ base::TimeTicks last_activity_time = |
+ ui::UserActivityDetector::Get()->last_activity_time(); |
+ std::string last_activity_name = |
+ ui::UserActivityDetector::Get()->last_activity_name(); |
+ if (!last_activity_time.is_null()) { |
+ LOG(WARNING) << "User input " << last_activity_name << " detected " |
+ << (base::TimeTicks::Now() - last_activity_time) |
+ << " ago, data upload is not allowed."; |
Andrew T Wilson (Slow)
2016/05/04 14:43:22
Can we also show how soon after boot the input hap
Marton Hunyady
2016/05/09 13:48:15
Done.
|
return false; |
+ } |
// Screenshot is allowed as long as we have not captured media. |
- return !has_captured_media_; |
+ if (has_captured_media_) { |
+ LOG(WARNING) << "Media has been captured, data upload is not allowed."; |
+ return false; |
+ } else { |
+ return true; |
+ } |
} |
void StatusUploader::OnRequestUpdate(int render_process_id, |