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

Unified Diff: chrome/browser/chromeos/device_settings_provider.cc

Issue 9703115: Add DeviceSettingProvider unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed copyright header. Created 8 years, 9 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/device_settings_provider.cc
diff --git a/chrome/browser/chromeos/device_settings_provider.cc b/chrome/browser/chromeos/device_settings_provider.cc
index b75ca815c47d00e272133bd60b314489914c23a6..41fbb4a60e7a952f02e1845c896c645412b8ea62 100644
--- a/chrome/browser/chromeos/device_settings_provider.cc
+++ b/chrome/browser/chromeos/device_settings_provider.cc
@@ -82,8 +82,10 @@ bool HasOldMetricsFile() {
} // namespace
DeviceSettingsProvider::DeviceSettingsProvider(
- const NotifyObserversCallback& notify_cb)
+ const NotifyObserversCallback& notify_cb,
+ SignedSettingsHelper* signed_settings_helper)
: CrosSettingsProvider(notify_cb),
+ signed_settings_helper_(signed_settings_helper),
ownership_status_(OwnershipService::GetSharedInstance()->GetStatus(true)),
migration_helper_(new SignedSettingsMigrationHelper()),
retries_left_(kNumRetriesLimit),
@@ -108,7 +110,7 @@ void DeviceSettingsProvider::Reload() {
RetrieveCachedData();
} else {
// Retrieve the real data.
- SignedSettingsHelper::Get()->StartRetrievePolicyOp(
+ signed_settings_helper_->StartRetrievePolicyOp(
base::Bind(&DeviceSettingsProvider::OnRetrievePolicyCompleted,
base::Unretained(this)));
}
@@ -195,7 +197,7 @@ void DeviceSettingsProvider::SetInPolicy() {
if (!RequestTrustedEntity()) {
// Otherwise we should first reload and apply on top of that.
- SignedSettingsHelper::Get()->StartRetrievePolicyOp(
+ signed_settings_helper_->StartRetrievePolicyOp(
base::Bind(&DeviceSettingsProvider::FinishSetInPolicy,
base::Unretained(this)));
return;
@@ -305,7 +307,7 @@ void DeviceSettingsProvider::SetInPolicy() {
if (ownership_status_ == OwnershipService::OWNERSHIP_TAKEN) {
em::PolicyFetchResponse policy_envelope;
policy_envelope.set_policy_data(policy_.SerializeAsString());
- SignedSettingsHelper::Get()->StartStorePolicyOp(
+ signed_settings_helper_->StartStorePolicyOp(
policy_envelope,
base::Bind(&DeviceSettingsProvider::OnStorePolicyCompleted,
base::Unretained(this)));
« no previous file with comments | « chrome/browser/chromeos/device_settings_provider.h ('k') | chrome/browser/chromeos/device_settings_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698