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

Unified Diff: chrome/browser/chromeos/settings/session_manager_operation.cc

Issue 769703003: SetManagementSettings() is moved to OwnerSettingsServiceChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Failing test fixed. Created 6 years 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/settings/session_manager_operation.cc
diff --git a/chrome/browser/chromeos/settings/session_manager_operation.cc b/chrome/browser/chromeos/settings/session_manager_operation.cc
index 6a7ed980cd8d1a2a90b1d69a25aacc991b79b22f..13a64f1b5c3d0f3e54db12bbc635f6b773fa82bc 100644
--- a/chrome/browser/chromeos/settings/session_manager_operation.cc
+++ b/chrome/browser/chromeos/settings/session_manager_operation.cc
@@ -239,65 +239,4 @@ void StoreSettingsOperation::HandleStoreResult(bool success) {
StartLoading();
}
-SignAndStoreSettingsOperation::SignAndStoreSettingsOperation(
- const Callback& callback,
- scoped_ptr<em::PolicyData> new_policy)
- : SessionManagerOperation(callback),
- new_policy_(new_policy.Pass()),
- weak_factory_(this) {
-}
-
-SignAndStoreSettingsOperation::~SignAndStoreSettingsOperation() {}
-
-void SignAndStoreSettingsOperation::Run() {
- if (!new_policy_) {
- ReportResult(DeviceSettingsService::STORE_POLICY_ERROR);
- return;
- }
- if (!owner_settings_service_) {
- ReportResult(DeviceSettingsService::STORE_KEY_UNAVAILABLE);
- return;
- }
- owner_settings_service_->IsOwnerAsync(
- base::Bind(&SignAndStoreSettingsOperation::StartSigning,
- weak_factory_.GetWeakPtr()));
-}
-
-void SignAndStoreSettingsOperation::StartSigning(bool is_owner) {
- if (!owner_settings_service_ || !is_owner) {
- ReportResult(DeviceSettingsService::STORE_KEY_UNAVAILABLE);
- return;
- }
-
- bool rv = owner_settings_service_->AssembleAndSignPolicyAsync(
- content::BrowserThread::GetBlockingPool(),
- new_policy_.Pass(),
- base::Bind(&SignAndStoreSettingsOperation::StoreDeviceSettings,
- weak_factory_.GetWeakPtr()));
- if (!rv) {
- ReportResult(DeviceSettingsService::STORE_KEY_UNAVAILABLE);
- return;
- }
-}
-
-void SignAndStoreSettingsOperation::StoreDeviceSettings(
- scoped_ptr<em::PolicyFetchResponse> policy_response) {
- if (!policy_response.get()) {
- ReportResult(DeviceSettingsService::STORE_POLICY_ERROR);
- return;
- }
-
- session_manager_client()->StoreDevicePolicy(
- policy_response->SerializeAsString(),
- base::Bind(&SignAndStoreSettingsOperation::HandleStoreResult,
- weak_factory_.GetWeakPtr()));
-}
-
-void SignAndStoreSettingsOperation::HandleStoreResult(bool success) {
- if (!success)
- ReportResult(DeviceSettingsService::STORE_OPERATION_FAILED);
- else
- StartLoading();
-}
-
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698