| 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/configuration_policy_handler_chromeos.h
" | 5 #include "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h
" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "ash/common/accessibility_types.h" | 14 #include "ash/common/accessibility_types.h" |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/json/json_reader.h" | 16 #include "base/json/json_reader.h" |
| 17 #include "base/json/json_writer.h" | 17 #include "base/json/json_writer.h" |
| 18 #include "base/logging.h" | 18 #include "base/logging.h" |
| 19 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
| 20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
| 22 #include "base/values.h" | 22 #include "base/values.h" |
| 23 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" | 23 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
| 24 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| 25 #include "chromeos/dbus/power_policy_controller.h" | 25 #include "chromeos/dbus/power_policy_controller.h" |
| 26 #include "chromeos/network/onc/onc_signature.h" | 26 #include "chromeos/network/onc/onc_signature.h" |
| 27 #include "chromeos/network/onc/onc_utils.h" | 27 #include "chromeos/network/onc/onc_utils.h" |
| 28 #include "chromeos/network/onc/onc_validator.h" | 28 #include "chromeos/network/onc/onc_validator.h" |
| 29 #include "components/onc/onc_constants.h" | 29 #include "components/onc/onc_constants.h" |
| 30 #include "components/onc/onc_pref_names.h" |
| 30 #include "components/policy/core/browser/policy_error_map.h" | 31 #include "components/policy/core/browser/policy_error_map.h" |
| 31 #include "components/policy/core/common/external_data_fetcher.h" | 32 #include "components/policy/core/common/external_data_fetcher.h" |
| 32 #include "components/policy/core/common/policy_map.h" | 33 #include "components/policy/core/common/policy_map.h" |
| 33 #include "components/policy/core/common/schema.h" | 34 #include "components/policy/core/common/schema.h" |
| 34 #include "components/policy/policy_constants.h" | 35 #include "components/policy/policy_constants.h" |
| 35 #include "components/prefs/pref_value_map.h" | 36 #include "components/prefs/pref_value_map.h" |
| 36 #include "components/strings/grit/components_strings.h" | 37 #include "components/strings/grit/components_strings.h" |
| 37 #include "crypto/sha2.h" | 38 #include "crypto/sha2.h" |
| 38 #include "url/gurl.h" | 39 #include "url/gurl.h" |
| 39 | 40 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 170 } |
| 170 | 171 |
| 171 void ExternalDataPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, | 172 void ExternalDataPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, |
| 172 PrefValueMap* prefs) { | 173 PrefValueMap* prefs) { |
| 173 } | 174 } |
| 174 | 175 |
| 175 // static | 176 // static |
| 176 NetworkConfigurationPolicyHandler* | 177 NetworkConfigurationPolicyHandler* |
| 177 NetworkConfigurationPolicyHandler::CreateForUserPolicy() { | 178 NetworkConfigurationPolicyHandler::CreateForUserPolicy() { |
| 178 return new NetworkConfigurationPolicyHandler( | 179 return new NetworkConfigurationPolicyHandler( |
| 179 key::kOpenNetworkConfiguration, | 180 key::kOpenNetworkConfiguration, onc::ONC_SOURCE_USER_POLICY, |
| 180 onc::ONC_SOURCE_USER_POLICY, | 181 onc::prefs::kOpenNetworkConfiguration); |
| 181 prefs::kOpenNetworkConfiguration); | |
| 182 } | 182 } |
| 183 | 183 |
| 184 // static | 184 // static |
| 185 NetworkConfigurationPolicyHandler* | 185 NetworkConfigurationPolicyHandler* |
| 186 NetworkConfigurationPolicyHandler::CreateForDevicePolicy() { | 186 NetworkConfigurationPolicyHandler::CreateForDevicePolicy() { |
| 187 return new NetworkConfigurationPolicyHandler( | 187 return new NetworkConfigurationPolicyHandler( |
| 188 key::kDeviceOpenNetworkConfiguration, | 188 key::kDeviceOpenNetworkConfiguration, onc::ONC_SOURCE_DEVICE_POLICY, |
| 189 onc::ONC_SOURCE_DEVICE_POLICY, | 189 onc::prefs::kDeviceOpenNetworkConfiguration); |
| 190 prefs::kDeviceOpenNetworkConfiguration); | |
| 191 } | 190 } |
| 192 | 191 |
| 193 NetworkConfigurationPolicyHandler::~NetworkConfigurationPolicyHandler() {} | 192 NetworkConfigurationPolicyHandler::~NetworkConfigurationPolicyHandler() {} |
| 194 | 193 |
| 195 bool NetworkConfigurationPolicyHandler::CheckPolicySettings( | 194 bool NetworkConfigurationPolicyHandler::CheckPolicySettings( |
| 196 const PolicyMap& policies, | 195 const PolicyMap& policies, |
| 197 PolicyErrorMap* errors) { | 196 PolicyErrorMap* errors) { |
| 198 const base::Value* value; | 197 const base::Value* value; |
| 199 if (!CheckAndGetValue(policies, errors, &value)) | 198 if (!CheckAndGetValue(policies, errors, &value)) |
| 200 return false; | 199 return false; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 478 |
| 480 value = GetValue(dict, kScreenLockDelayAC); | 479 value = GetValue(dict, kScreenLockDelayAC); |
| 481 if (value) | 480 if (value) |
| 482 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, std::move(value)); | 481 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, std::move(value)); |
| 483 value = GetValue(dict, kScreenLockDelayBattery); | 482 value = GetValue(dict, kScreenLockDelayBattery); |
| 484 if (value) | 483 if (value) |
| 485 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, std::move(value)); | 484 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, std::move(value)); |
| 486 } | 485 } |
| 487 | 486 |
| 488 } // namespace policy | 487 } // namespace policy |
| OLD | NEW |