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

Unified Diff: chrome/browser/chromeos/policy/status_uploader.cc

Issue 1135413002: Disable screenshot uploading if there has been user input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self-review Created 5 years, 7 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 | « chrome/browser/chromeos/policy/status_uploader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5bf420246ff77ca9ba5315671486de774cd82099..fd95fcab26f9197b41f33c0ab7461ed255193896 100644
--- a/chrome/browser/chromeos/policy/status_uploader.cc
+++ b/chrome/browser/chromeos/policy/status_uploader.cc
@@ -10,11 +10,13 @@
#include "base/bind_helpers.h"
#include "base/location.h"
#include "base/sequenced_task_runner.h"
+#include "chrome/browser/chromeos/policy/device_local_account.h"
#include "chrome/browser/chromeos/policy/device_status_collector.h"
#include "chromeos/settings/cros_settings_names.h"
#include "chromeos/settings/cros_settings_provider.h"
#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "components/policy/core/common/cloud/device_management_service.h"
+#include "ui/base/user_activity/user_activity_detector.h"
namespace {
const int kMinUploadDelayMs = 60 * 1000; // 60 seconds
@@ -103,6 +105,22 @@ void StatusUploader::RefreshUploadFrequency() {
ScheduleNextStatusUpload();
}
+bool StatusUploader::IsSessionDataUploadAllowed() {
+ // Check if we're in an auto-launched kiosk session.
+ scoped_ptr<DeviceLocalAccount> account =
+ collector_->GetAutoLaunchedKioskSessionInfo();
+ if (!account)
+ return false;
+
+ // Check if there has been any user input.
+ if (!ui::UserActivityDetector::Get()->last_activity_time().is_null())
+ return false;
+
+ // TODO(atwilson): Check if we've captured any audio/video data
+ // (http://crbug.com/487261).
+ return true;
+}
+
void StatusUploader::UploadStatus() {
enterprise_management::DeviceStatusReportRequest device_status;
bool have_device_status = collector_->GetDeviceStatus(&device_status);
« no previous file with comments | « chrome/browser/chromeos/policy/status_uploader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698