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/extensions/manifest.h" | 15 #include "chrome/common/extensions/manifest.h" |
16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.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 "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h
" | 22 #include "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h
" |
22 #endif // defined(OS_CHROMEOS) | 23 #endif // defined(OS_CHROMEOS) |
23 | 24 |
24 namespace policy { | 25 namespace policy { |
25 | 26 |
26 namespace { | 27 namespace { |
27 | 28 |
28 // Maps a policy type to a preference path, and to the expected value type. | 29 // Maps a policy type to a preference path, and to the expected value type. |
29 // This is the entry type of |kSimplePolicyMap| below. | 30 // This is the entry type of |kSimplePolicyMap| below. |
30 struct PolicyToPreferenceMapEntry { | 31 struct PolicyToPreferenceMapEntry { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 Value::TYPE_BOOLEAN }, | 377 Value::TYPE_BOOLEAN }, |
377 { key::kLargeCursorEnabled, | 378 { key::kLargeCursorEnabled, |
378 prefs::kLargeCursorEnabled, | 379 prefs::kLargeCursorEnabled, |
379 Value::TYPE_BOOLEAN }, | 380 Value::TYPE_BOOLEAN }, |
380 { key::kSpokenFeedbackEnabled, | 381 { key::kSpokenFeedbackEnabled, |
381 prefs::kSpokenFeedbackEnabled, | 382 prefs::kSpokenFeedbackEnabled, |
382 Value::TYPE_BOOLEAN }, | 383 Value::TYPE_BOOLEAN }, |
383 { key::kHighContrastEnabled, | 384 { key::kHighContrastEnabled, |
384 prefs::kHighContrastEnabled, | 385 prefs::kHighContrastEnabled, |
385 Value::TYPE_BOOLEAN }, | 386 Value::TYPE_BOOLEAN }, |
| 387 { key::kDeviceLoginScreenDefaultLargeCursorEnabled, |
| 388 NULL, |
| 389 Value::TYPE_BOOLEAN }, |
| 390 { key::kDeviceLoginScreenDefaultSpokenFeedbackEnabled, |
| 391 NULL, |
| 392 Value::TYPE_BOOLEAN }, |
| 393 { key::kDeviceLoginScreenDefaultHighContrastEnabled, |
| 394 NULL, |
| 395 Value::TYPE_BOOLEAN }, |
386 { key::kRebootAfterUpdate, | 396 { key::kRebootAfterUpdate, |
387 prefs::kRebootAfterUpdate, | 397 prefs::kRebootAfterUpdate, |
388 Value::TYPE_BOOLEAN }, | 398 Value::TYPE_BOOLEAN }, |
389 { key::kAttestationEnabledForUser, | 399 { key::kAttestationEnabledForUser, |
390 prefs::kAttestationEnabled, | 400 prefs::kAttestationEnabled, |
391 Value::TYPE_BOOLEAN }, | 401 Value::TYPE_BOOLEAN }, |
392 #endif // defined(OS_CHROMEOS) | 402 #endif // defined(OS_CHROMEOS) |
393 | 403 |
394 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) | 404 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) |
395 { key::kBackgroundModeEnabled, | 405 { key::kBackgroundModeEnabled, |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 prefs::kPowerPresentationIdleDelayFactor, | 541 prefs::kPowerPresentationIdleDelayFactor, |
532 100, INT_MAX, true)); | 542 100, INT_MAX, true)); |
533 handlers_.push_back( | 543 handlers_.push_back( |
534 new IntPercentageToDoublePolicyHandler( | 544 new IntPercentageToDoublePolicyHandler( |
535 key::kUserActivityScreenDimDelayScale, | 545 key::kUserActivityScreenDimDelayScale, |
536 prefs::kPowerUserActivityScreenDimDelayFactor, | 546 prefs::kPowerUserActivityScreenDimDelayFactor, |
537 100, INT_MAX, true)); | 547 100, INT_MAX, true)); |
538 handlers_.push_back(new IntRangePolicyHandler(key::kUptimeLimit, | 548 handlers_.push_back(new IntRangePolicyHandler(key::kUptimeLimit, |
539 prefs::kUptimeLimit, | 549 prefs::kUptimeLimit, |
540 3600, INT_MAX, true)); | 550 3600, INT_MAX, true)); |
| 551 handlers_.push_back(new IntRangePolicyHandler( |
| 552 key::kDeviceLoginScreenDefaultScreenMagnifierType, |
| 553 NULL, |
| 554 0, ash::MAGNIFIER_FULL, false)); |
541 #endif // defined(OS_CHROMEOS) | 555 #endif // defined(OS_CHROMEOS) |
542 } | 556 } |
543 | 557 |
544 ConfigurationPolicyHandlerList::~ConfigurationPolicyHandlerList() { | 558 ConfigurationPolicyHandlerList::~ConfigurationPolicyHandlerList() { |
545 STLDeleteElements(&handlers_); | 559 STLDeleteElements(&handlers_); |
546 } | 560 } |
547 | 561 |
548 void ConfigurationPolicyHandlerList::ApplyPolicySettings( | 562 void ConfigurationPolicyHandlerList::ApplyPolicySettings( |
549 const PolicyMap& policies, | 563 const PolicyMap& policies, |
550 PrefValueMap* prefs, | 564 PrefValueMap* prefs, |
(...skipping 17 matching lines...) Expand all Loading... |
568 } | 582 } |
569 | 583 |
570 void ConfigurationPolicyHandlerList::PrepareForDisplaying( | 584 void ConfigurationPolicyHandlerList::PrepareForDisplaying( |
571 PolicyMap* policies) const { | 585 PolicyMap* policies) const { |
572 std::vector<ConfigurationPolicyHandler*>::const_iterator handler; | 586 std::vector<ConfigurationPolicyHandler*>::const_iterator handler; |
573 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) | 587 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) |
574 (*handler)->PrepareForDisplaying(policies); | 588 (*handler)->PrepareForDisplaying(policies); |
575 } | 589 } |
576 | 590 |
577 } // namespace policy | 591 } // namespace policy |
OLD | NEW |