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

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

Issue 2371213002: Refactor: Inject StatisticsProvider as a dependency of DeviceCloudPolicyInitializer. (Closed)
Patch Set: Inject StatisticsProvider as a dependency of DeviceCloudPolicyInitializer. Created 4 years, 3 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/device_cloud_policy_initializer.h
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_initializer.h b/chrome/browser/chromeos/policy/device_cloud_policy_initializer.h
index 5859066f61b1ba1b6316acde5c19578d3b697008..db6ab936c6c091164547534cc267c275d4affbc0 100644
--- a/chrome/browser/chromeos/policy/device_cloud_policy_initializer.h
+++ b/chrome/browser/chromeos/policy/device_cloud_policy_initializer.h
@@ -29,6 +29,9 @@ namespace chromeos {
namespace attestation {
class AttestationFlow;
}
+namespace system {
+class StatisticsProvider;
+}
}
namespace cryptohome {
@@ -62,7 +65,8 @@ class DeviceCloudPolicyInitializer : public CloudPolicyStore::Observer {
DeviceCloudPolicyStoreChromeOS* device_store,
DeviceCloudPolicyManagerChromeOS* manager,
cryptohome::AsyncMethodCaller* async_method_caller,
- std::unique_ptr<chromeos::attestation::AttestationFlow> attestation_flow);
+ std::unique_ptr<chromeos::attestation::AttestationFlow> attestation_flow,
+ chromeos::system::StatisticsProvider* statistics_provider);
~DeviceCloudPolicyInitializer() override;
@@ -132,6 +136,10 @@ class DeviceCloudPolicyInitializer : public CloudPolicyStore::Observer {
void TryToCreateClient();
void StartConnection(std::unique_ptr<CloudPolicyClient> client);
+ // Get a machine flag from |statistics_provider_|, returning the given
+ // |default_value| if not present.
+ bool GetMachineFlag(const std::string& key, bool default_value) const;
+
PrefService* local_state_;
DeviceManagementService* enterprise_service_;
scoped_refptr<base::SequencedTaskRunner> background_task_runner_;
@@ -140,6 +148,7 @@ class DeviceCloudPolicyInitializer : public CloudPolicyStore::Observer {
DeviceCloudPolicyStoreChromeOS* device_store_;
DeviceCloudPolicyManagerChromeOS* manager_;
std::unique_ptr<chromeos::attestation::AttestationFlow> attestation_flow_;
+ chromeos::system::StatisticsProvider* statistics_provider_;
bool is_initialized_ = false;
// Non-NULL if there is an enrollment operation pending.

Powered by Google App Engine
This is Rietveld 408576698