| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_store.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_store.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chromeos/dbus/power_policy_controller.h" | 10 #include "chromeos/dbus/power_policy_controller.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 POLICY_LEVEL_MANDATORY, | 88 POLICY_LEVEL_MANDATORY, |
| 89 POLICY_SCOPE_USER, | 89 POLICY_SCOPE_USER, |
| 90 base::Value::CreateIntegerValue( | 90 base::Value::CreateIntegerValue( |
| 91 chromeos::PowerPolicyController::ACTION_STOP_SESSION), | 91 chromeos::PowerPolicyController::ACTION_STOP_SESSION), |
| 92 NULL); | 92 NULL); |
| 93 // Force the |ShelfAutoHideBehavior| policy to |Never|, ensuring that the ash | 93 // Force the |ShelfAutoHideBehavior| policy to |Never|, ensuring that the ash |
| 94 // shelf does not auto-hide. | 94 // shelf does not auto-hide. |
| 95 policy_map_.Set(key::kShelfAutoHideBehavior, | 95 policy_map_.Set(key::kShelfAutoHideBehavior, |
| 96 POLICY_LEVEL_MANDATORY, | 96 POLICY_LEVEL_MANDATORY, |
| 97 POLICY_SCOPE_USER, | 97 POLICY_SCOPE_USER, |
| 98 Value::CreateStringValue("Never"), | 98 base::Value::CreateStringValue("Never"), |
| 99 NULL); | 99 NULL); |
| 100 // Force the |ShowLogoutButtonInTray| policy to |true|, ensuring that a big, | 100 // Force the |ShowLogoutButtonInTray| policy to |true|, ensuring that a big, |
| 101 // red logout button is shown in the ash system tray. | 101 // red logout button is shown in the ash system tray. |
| 102 policy_map_.Set(key::kShowLogoutButtonInTray, | 102 policy_map_.Set(key::kShowLogoutButtonInTray, |
| 103 POLICY_LEVEL_MANDATORY, | 103 POLICY_LEVEL_MANDATORY, |
| 104 POLICY_SCOPE_USER, | 104 POLICY_SCOPE_USER, |
| 105 Value::CreateBooleanValue(true), | 105 base::Value::CreateBooleanValue(true), |
| 106 NULL); | 106 NULL); |
| 107 // Force the |FullscreenAllowed| policy to |false|, ensuring that the ash | 107 // Force the |FullscreenAllowed| policy to |false|, ensuring that the ash |
| 108 // shelf cannot be hidden by entering fullscreen mode. | 108 // shelf cannot be hidden by entering fullscreen mode. |
| 109 policy_map_.Set(key::kFullscreenAllowed, | 109 policy_map_.Set(key::kFullscreenAllowed, |
| 110 POLICY_LEVEL_MANDATORY, | 110 POLICY_LEVEL_MANDATORY, |
| 111 POLICY_SCOPE_USER, | 111 POLICY_SCOPE_USER, |
| 112 Value::CreateBooleanValue(false), | 112 base::Value::CreateBooleanValue(false), |
| 113 NULL); | 113 NULL); |
| 114 | 114 |
| 115 status_ = STATUS_OK; | 115 status_ = STATUS_OK; |
| 116 NotifyStoreLoaded(); | 116 NotifyStoreLoaded(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void DeviceLocalAccountPolicyStore::StoreValidatedPolicy( | 119 void DeviceLocalAccountPolicyStore::StoreValidatedPolicy( |
| 120 UserCloudPolicyValidator* validator) { | 120 UserCloudPolicyValidator* validator) { |
| 121 if (!validator->success()) { | 121 if (!validator->success()) { |
| 122 status_ = CloudPolicyStore::STATUS_VALIDATION_ERROR; | 122 status_ = CloudPolicyStore::STATUS_VALIDATION_ERROR; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 valid_timestamp_required | 188 valid_timestamp_required |
| 189 ? CloudPolicyValidatorBase::TIMESTAMP_REQUIRED | 189 ? CloudPolicyValidatorBase::TIMESTAMP_REQUIRED |
| 190 : CloudPolicyValidatorBase::TIMESTAMP_NOT_REQUIRED, | 190 : CloudPolicyValidatorBase::TIMESTAMP_NOT_REQUIRED, |
| 191 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); | 191 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); |
| 192 validator->ValidatePayload(); | 192 validator->ValidatePayload(); |
| 193 validator->ValidateSignature(*key->public_key(), false); | 193 validator->ValidateSignature(*key->public_key(), false); |
| 194 validator.release()->StartValidation(callback); | 194 validator.release()->StartValidation(callback); |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace policy | 197 } // namespace policy |
| OLD | NEW |