| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/magnifier/magnifier_constants.h" | |
| 11 #include "base/callback.h" | 10 #include "base/callback.h" |
| 12 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 13 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
| 14 #include "base/logging.h" | 13 #include "base/logging.h" |
| 15 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/prefs/pref_value_map.h" | 15 #include "base/prefs/pref_value_map.h" |
| 17 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 19 #include "base/values.h" | 18 #include "base/values.h" |
| 20 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" | 19 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
| 21 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
| 22 #include "chromeos/dbus/power_policy_controller.h" | 21 #include "chromeos/dbus/power_policy_controller.h" |
| 23 #include "chromeos/network/onc/onc_signature.h" | 22 #include "chromeos/network/onc/onc_signature.h" |
| 24 #include "chromeos/network/onc/onc_utils.h" | 23 #include "chromeos/network/onc/onc_utils.h" |
| 25 #include "chromeos/network/onc/onc_validator.h" | 24 #include "chromeos/network/onc/onc_validator.h" |
| 26 #include "components/onc/onc_constants.h" | 25 #include "components/onc/onc_constants.h" |
| 27 #include "components/policy/core/browser/policy_error_map.h" | 26 #include "components/policy/core/browser/policy_error_map.h" |
| 28 #include "components/policy/core/common/external_data_fetcher.h" | 27 #include "components/policy/core/common/external_data_fetcher.h" |
| 29 #include "components/policy/core/common/policy_map.h" | 28 #include "components/policy/core/common/policy_map.h" |
| 30 #include "components/policy/core/common/schema.h" | 29 #include "components/policy/core/common/schema.h" |
| 31 #include "crypto/sha2.h" | 30 #include "crypto/sha2.h" |
| 32 #include "grit/components_strings.h" | 31 #include "grit/components_strings.h" |
| 33 #include "policy/policy_constants.h" | 32 #include "policy/policy_constants.h" |
| 33 #include "ui/chromeos/accessibility_types.h" |
| 34 #include "url/gurl.h" | 34 #include "url/gurl.h" |
| 35 | 35 |
| 36 namespace policy { | 36 namespace policy { |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 const char kSubkeyURL[] = "url"; | 40 const char kSubkeyURL[] = "url"; |
| 41 const char kSubkeyHash[] = "hash"; | 41 const char kSubkeyHash[] = "hash"; |
| 42 | 42 |
| 43 bool GetSubkeyString(const base::DictionaryValue& dict, | 43 bool GetSubkeyString(const base::DictionaryValue& dict, |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 app_dict->SetString(ash::kPinnedAppsPrefAppIDPath, id); | 327 app_dict->SetString(ash::kPinnedAppsPrefAppIDPath, id); |
| 328 pinned_apps_list->Append(app_dict); | 328 pinned_apps_list->Append(app_dict); |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 prefs->SetValue(pref_path(), pinned_apps_list); | 331 prefs->SetValue(pref_path(), pinned_apps_list); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 ScreenMagnifierPolicyHandler::ScreenMagnifierPolicyHandler() | 335 ScreenMagnifierPolicyHandler::ScreenMagnifierPolicyHandler() |
| 336 : IntRangePolicyHandlerBase(key::kScreenMagnifierType, | 336 : IntRangePolicyHandlerBase(key::kScreenMagnifierType, |
| 337 0, ash::MAGNIFIER_FULL, false) { | 337 0, ui::MAGNIFIER_FULL, false) { |
| 338 } | 338 } |
| 339 | 339 |
| 340 ScreenMagnifierPolicyHandler::~ScreenMagnifierPolicyHandler() { | 340 ScreenMagnifierPolicyHandler::~ScreenMagnifierPolicyHandler() { |
| 341 } | 341 } |
| 342 | 342 |
| 343 void ScreenMagnifierPolicyHandler::ApplyPolicySettings( | 343 void ScreenMagnifierPolicyHandler::ApplyPolicySettings( |
| 344 const PolicyMap& policies, | 344 const PolicyMap& policies, |
| 345 PrefValueMap* prefs) { | 345 PrefValueMap* prefs) { |
| 346 const base::Value* value = policies.GetValue(policy_name()); | 346 const base::Value* value = policies.GetValue(policy_name()); |
| 347 int value_in_range; | 347 int value_in_range; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 | 474 |
| 475 value = GetValue(dict, kScreenLockDelayAC); | 475 value = GetValue(dict, kScreenLockDelayAC); |
| 476 if (value) | 476 if (value) |
| 477 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, value.release()); | 477 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, value.release()); |
| 478 value = GetValue(dict, kScreenLockDelayBattery); | 478 value = GetValue(dict, kScreenLockDelayBattery); |
| 479 if (value) | 479 if (value) |
| 480 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, value.release()); | 480 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, value.release()); |
| 481 } | 481 } |
| 482 | 482 |
| 483 } // namespace policy | 483 } // namespace policy |
| OLD | NEW |