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

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: Fixed leak in test. 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
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..934a57f076155b6a134425723a22a2bb8ead40c1 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
@@ -25,6 +27,9 @@ namespace policy {
const int64 StatusUploader::kDefaultUploadDelayMs =
3 * 60 * 60 * 1000; // 3 hours
+StatusUploader::StatusUploader() : weak_factory_(this) {
+}
+
StatusUploader::StatusUploader(
CloudPolicyClient* client,
scoped_ptr<DeviceStatusCollector> collector,
@@ -103,6 +108,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);

Powered by Google App Engine
This is Rietveld 408576698