| 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
|
|
|