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

Unified Diff: chrome/browser/chromeos/policy/system_log_uploader.h

Issue 1280003004: Added policy to disable/enable a system log upload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/system_log_uploader.h
diff --git a/chrome/browser/chromeos/policy/system_log_uploader.h b/chrome/browser/chromeos/policy/system_log_uploader.h
index 35d78ae5e07ef528d649b73804b99bb5a7f4845c..397a77dcdbd54d12b6ac192b5690e6c9f9d58825 100644
--- a/chrome/browser/chromeos/policy/system_log_uploader.h
+++ b/chrome/browser/chromeos/policy/system_log_uploader.h
@@ -13,6 +13,7 @@
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "chrome/browser/chromeos/policy/upload_job.h"
+#include "chrome/browser/chromeos/settings/cros_settings.h"
namespace base {
class SequencedTaskRunner;
@@ -76,6 +77,9 @@ class SystemLogUploader : public UploadJob::Delegate {
void OnFailure(UploadJob::ErrorCode error_code) override;
private:
+ // Updates the system log upload enabled field from settings.
+ void RefreshUploadSettings();
+
// Starts the system log loading process.
void StartLogUpload();
@@ -105,6 +109,15 @@ class SystemLogUploader : public UploadJob::Delegate {
// The Delegate is used to load system logs and create UploadJobs.
scoped_ptr<Delegate> syslog_delegate_;
+ // True if system log upload is enabled. Kept cached in this object because
+ // CrosSettings can switch to an unstrusted state temporarily, and we want to
+ // use the last-known trusted values.
+ bool upload_enabled_;
+
+ // Observer to changes in system log upload settings.
+ scoped_ptr<chromeos::CrosSettings::ObserverSubscription>
+ upload_enabled_observer_;
+
base::ThreadChecker thread_checker_;
// Note: This should remain the last member so it'll be destroyed and

Powered by Google App Engine
This is Rietveld 408576698