Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: chrome/browser/chromeos/policy/device_policy_decoder_chromeos.cc

Issue 16658015: Add device policies to control accessibility settings on the login screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed leaky tests. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_policy_decoder_chromeos.h" 5 #include "chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 409
410 if (container.has_reboot_after_update()) { 410 if (container.has_reboot_after_update()) {
411 policies->Set(key::kRebootAfterUpdate, 411 policies->Set(key::kRebootAfterUpdate,
412 POLICY_LEVEL_MANDATORY, 412 POLICY_LEVEL_MANDATORY,
413 POLICY_SCOPE_MACHINE, 413 POLICY_SCOPE_MACHINE,
414 Value::CreateBooleanValue(container.reboot_after_update())); 414 Value::CreateBooleanValue(container.reboot_after_update()));
415 } 415 }
416 } 416 }
417 } 417 }
418 418
419 void DecodeAccessibilityPolicies(const em::ChromeDeviceSettingsProto& policy,
420 PolicyMap* policies) {
421 if (policy.has_accessibility_settings()) {
422 const em::AccessibilitySettingsProto&
423 container(policy.accessibility_settings());
424
425 if (container.has_login_screen_default_large_cursor_enabled()) {
426 policies->Set(
427 key::kDeviceLoginScreenDefaultLargeCursorEnabled,
428 POLICY_LEVEL_MANDATORY,
429 POLICY_SCOPE_MACHINE,
430 Value::CreateBooleanValue(
431 container.login_screen_default_large_cursor_enabled()));
432 }
433
434 if (container.has_login_screen_default_spoken_feedback_enabled()) {
435 policies->Set(
436 key::kDeviceLoginScreenDefaultSpokenFeedbackEnabled,
437 POLICY_LEVEL_MANDATORY,
438 POLICY_SCOPE_MACHINE,
439 Value::CreateBooleanValue(
440 container.login_screen_default_spoken_feedback_enabled()));
441 }
442
443 if (container.has_login_screen_default_high_contrast_enabled()) {
444 policies->Set(
445 key::kDeviceLoginScreenDefaultHighContrastEnabled,
446 POLICY_LEVEL_MANDATORY,
447 POLICY_SCOPE_MACHINE,
448 Value::CreateBooleanValue(
449 container.login_screen_default_high_contrast_enabled()));
450 }
451
452 if (container.has_login_screen_default_screen_magnifier_type()) {
453 policies->Set(
454 key::kDeviceLoginScreenDefaultScreenMagnifierType,
455 POLICY_LEVEL_MANDATORY,
456 POLICY_SCOPE_MACHINE,
457 DecodeIntegerValue(
458 container.login_screen_default_screen_magnifier_type()));
459 }
460 }
461 }
462
419 void DecodeGenericPolicies(const em::ChromeDeviceSettingsProto& policy, 463 void DecodeGenericPolicies(const em::ChromeDeviceSettingsProto& policy,
420 PolicyMap* policies) { 464 PolicyMap* policies) {
421 if (policy.has_device_policy_refresh_rate()) { 465 if (policy.has_device_policy_refresh_rate()) {
422 const em::DevicePolicyRefreshRateProto& container( 466 const em::DevicePolicyRefreshRateProto& container(
423 policy.device_policy_refresh_rate()); 467 policy.device_policy_refresh_rate());
424 if (container.has_device_policy_refresh_rate()) { 468 if (container.has_device_policy_refresh_rate()) {
425 policies->Set(key::kDevicePolicyRefreshRate, 469 policies->Set(key::kDevicePolicyRefreshRate,
426 POLICY_LEVEL_MANDATORY, 470 POLICY_LEVEL_MANDATORY,
427 POLICY_SCOPE_MACHINE, 471 POLICY_SCOPE_MACHINE,
428 DecodeIntegerValue(container.device_policy_refresh_rate())); 472 DecodeIntegerValue(container.device_policy_refresh_rate()));
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 570
527 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, 571 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy,
528 PolicyMap* policies, 572 PolicyMap* policies,
529 EnterpriseInstallAttributes* install_attributes) { 573 EnterpriseInstallAttributes* install_attributes) {
530 // Decode the various groups of policies. 574 // Decode the various groups of policies.
531 DecodeLoginPolicies(policy, policies); 575 DecodeLoginPolicies(policy, policies);
532 DecodeKioskPolicies(policy, policies, install_attributes); 576 DecodeKioskPolicies(policy, policies, install_attributes);
533 DecodeNetworkPolicies(policy, policies, install_attributes); 577 DecodeNetworkPolicies(policy, policies, install_attributes);
534 DecodeReportingPolicies(policy, policies); 578 DecodeReportingPolicies(policy, policies);
535 DecodeAutoUpdatePolicies(policy, policies); 579 DecodeAutoUpdatePolicies(policy, policies);
580 DecodeAccessibilityPolicies(policy, policies);
536 DecodeGenericPolicies(policy, policies); 581 DecodeGenericPolicies(policy, policies);
537 } 582 }
538 583
539 } // namespace policy 584 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698