| 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/policy/configuration_policy_handler_list.h" | 5 #include "chrome/browser/policy/configuration_policy_handler_list.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/prefs/pref_value_map.h" | 9 #include "base/prefs/pref_value_map.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/policy/configuration_policy_handler.h" | 12 #include "chrome/browser/policy/configuration_policy_handler.h" |
| 13 #include "chrome/browser/policy/policy_error_map.h" | 13 #include "chrome/browser/policy/policy_error_map.h" |
| 14 #include "chrome/browser/policy/policy_map.h" | 14 #include "chrome/browser/policy/policy_map.h" |
| 15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 16 #include "extensions/common/manifest.h" | 16 #include "extensions/common/manifest.h" |
| 17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 18 #include "policy/policy_constants.h" | 18 #include "policy/policy_constants.h" |
| 19 | 19 |
| 20 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
| 21 #include "ash/magnifier/magnifier_constants.h" | 21 #include "ash/magnifier/magnifier_constants.h" |
| 22 #include "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h
" | 22 #include "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h
" |
| 23 #include "chromeos/dbus/power_policy_controller.h" | 23 #include "chromeos/dbus/power_policy_controller.h" |
| 24 #endif // defined(OS_CHROMEOS) | 24 #endif // defined(OS_CHROMEOS) |
| 25 | 25 |
| 26 #if defined(OS_ANDROID) | 26 #if defined(OS_ANDROID) |
| 27 #include "chrome/browser/policy/configuration_policy_handler_android.h" | 27 #include "chrome/browser/policy/configuration_policy_handler_android.h" |
| 28 #endif // defined(OS_ANDROID) | 28 #endif // defined(OS_ANDROID) |
| 29 | 29 |
| 30 #if !defined(OS_MACOSX) |
| 31 #include "apps/pref_names.h" |
| 32 #endif |
| 33 |
| 30 namespace policy { | 34 namespace policy { |
| 31 | 35 |
| 32 namespace { | 36 namespace { |
| 33 | 37 |
| 34 // Maps a policy type to a preference path, and to the expected value type. | 38 // Maps a policy type to a preference path, and to the expected value type. |
| 35 // This is the entry type of |kSimplePolicyMap| below. | 39 // This is the entry type of |kSimplePolicyMap| below. |
| 36 struct PolicyToPreferenceMapEntry { | 40 struct PolicyToPreferenceMapEntry { |
| 37 const char* policy_name; | 41 const char* policy_name; |
| 38 const char* preference_path; | 42 const char* preference_path; |
| 39 base::Value::Type value_type; | 43 base::Value::Type value_type; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 { key::kContentPackManualBehaviorHosts, | 343 { key::kContentPackManualBehaviorHosts, |
| 340 prefs::kManagedModeManualHosts, | 344 prefs::kManagedModeManualHosts, |
| 341 Value::TYPE_DICTIONARY }, | 345 Value::TYPE_DICTIONARY }, |
| 342 { key::kContentPackManualBehaviorURLs, | 346 { key::kContentPackManualBehaviorURLs, |
| 343 prefs::kManagedModeManualURLs, | 347 prefs::kManagedModeManualURLs, |
| 344 Value::TYPE_DICTIONARY }, | 348 Value::TYPE_DICTIONARY }, |
| 345 { key::kSupervisedUserCreationEnabled, | 349 { key::kSupervisedUserCreationEnabled, |
| 346 prefs::kManagedUserCreationAllowed, | 350 prefs::kManagedUserCreationAllowed, |
| 347 Value::TYPE_BOOLEAN }, | 351 Value::TYPE_BOOLEAN }, |
| 348 | 352 |
| 353 #if !defined(OS_MACOSX) |
| 354 { key::kFullscreenAllowed, |
| 355 prefs::kFullscreenAllowed, |
| 356 Value::TYPE_BOOLEAN }, |
| 357 { key::kFullscreenAllowed, |
| 358 apps::prefs::kAppFullscreenAllowed, |
| 359 Value::TYPE_BOOLEAN }, |
| 360 #endif // !defined(OS_MACOSX) |
| 361 |
| 349 #if defined(OS_CHROMEOS) | 362 #if defined(OS_CHROMEOS) |
| 350 { key::kChromeOsLockOnIdleSuspend, | 363 { key::kChromeOsLockOnIdleSuspend, |
| 351 prefs::kEnableScreenLock, | 364 prefs::kEnableScreenLock, |
| 352 Value::TYPE_BOOLEAN }, | 365 Value::TYPE_BOOLEAN }, |
| 353 { key::kChromeOsReleaseChannel, | 366 { key::kChromeOsReleaseChannel, |
| 354 prefs::kChromeOsReleaseChannel, | 367 prefs::kChromeOsReleaseChannel, |
| 355 Value::TYPE_STRING }, | 368 Value::TYPE_STRING }, |
| 356 { key::kDriveDisabled, | 369 { key::kDriveDisabled, |
| 357 prefs::kDisableDrive, | 370 prefs::kDisableDrive, |
| 358 Value::TYPE_BOOLEAN }, | 371 Value::TYPE_BOOLEAN }, |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 } | 626 } |
| 614 | 627 |
| 615 void ConfigurationPolicyHandlerList::PrepareForDisplaying( | 628 void ConfigurationPolicyHandlerList::PrepareForDisplaying( |
| 616 PolicyMap* policies) const { | 629 PolicyMap* policies) const { |
| 617 std::vector<ConfigurationPolicyHandler*>::const_iterator handler; | 630 std::vector<ConfigurationPolicyHandler*>::const_iterator handler; |
| 618 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) | 631 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) |
| 619 (*handler)->PrepareForDisplaying(policies); | 632 (*handler)->PrepareForDisplaying(policies); |
| 620 } | 633 } |
| 621 | 634 |
| 622 } // namespace policy | 635 } // namespace policy |
| OLD | NEW |