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

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

Issue 18153007: Add policies to control power management on the Chrome OS login screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed some very verbose comments. Created 7 years, 5 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 policies->Set( 466 policies->Set(
467 key::kDeviceLoginScreenDefaultScreenMagnifierType, 467 key::kDeviceLoginScreenDefaultScreenMagnifierType,
468 POLICY_LEVEL_MANDATORY, 468 POLICY_LEVEL_MANDATORY,
469 POLICY_SCOPE_MACHINE, 469 POLICY_SCOPE_MACHINE,
470 DecodeIntegerValue( 470 DecodeIntegerValue(
471 container.login_screen_default_screen_magnifier_type())); 471 container.login_screen_default_screen_magnifier_type()));
472 } 472 }
473 } 473 }
474 } 474 }
475 475
476 void DecodePowerManagementPolicies(const em::ChromeDeviceSettingsProto& policy,
477 PolicyMap* policies) {
478 if (policy.has_power_management()) {
479 const em::PowerManagementProto& container(policy.power_management());
480
481 if (container.has_login_screen_screen_dim_delay_ac()) {
482 policies->Set(
483 key::kDeviceLoginScreenScreenDimDelayAC,
484 POLICY_LEVEL_MANDATORY,
485 POLICY_SCOPE_MACHINE,
486 DecodeIntegerValue(container.login_screen_screen_dim_delay_ac()));
487 }
488
489 if (container.has_login_screen_screen_off_delay_ac()) {
490 policies->Set(
491 key::kDeviceLoginScreenScreenOffDelayAC,
492 POLICY_LEVEL_MANDATORY,
493 POLICY_SCOPE_MACHINE,
494 DecodeIntegerValue(container.login_screen_screen_off_delay_ac()));
495 }
496
497 if (container.has_login_screen_idle_delay_ac()) {
498 policies->Set(
499 key::kDeviceLoginScreenIdleDelayAC,
500 POLICY_LEVEL_MANDATORY,
501 POLICY_SCOPE_MACHINE,
502 DecodeIntegerValue(container.login_screen_idle_delay_ac()));
503 }
504
505 if (container.has_login_screen_screen_dim_delay_battery()) {
506 policies->Set(
507 key::kDeviceLoginScreenScreenDimDelayBattery,
508 POLICY_LEVEL_MANDATORY,
509 POLICY_SCOPE_MACHINE,
510 DecodeIntegerValue(
511 container.login_screen_screen_dim_delay_battery()));
512 }
513
514 if (container.has_login_screen_screen_off_delay_battery()) {
515 policies->Set(
516 key::kDeviceLoginScreenScreenOffDelayBattery,
517 POLICY_LEVEL_MANDATORY,
518 POLICY_SCOPE_MACHINE,
519 DecodeIntegerValue(
520 container.login_screen_screen_off_delay_battery()));
521 }
522
523 if (container.has_login_screen_idle_delay_battery()) {
524 policies->Set(
525 key::kDeviceLoginScreenIdleDelayBattery,
526 POLICY_LEVEL_MANDATORY,
527 POLICY_SCOPE_MACHINE,
528 DecodeIntegerValue(container.login_screen_idle_delay_battery()));
529 }
530
531 if (container.has_login_screen_idle_action_ac()) {
532 policies->Set(
533 key::kDeviceLoginScreenIdleActionAC,
534 POLICY_LEVEL_MANDATORY,
535 POLICY_SCOPE_MACHINE,
536 DecodeIntegerValue(container.login_screen_idle_action_ac()));
537 }
538
539 if (container.has_login_screen_idle_action_battery()) {
540 policies->Set(
541 key::kDeviceLoginScreenIdleActionBattery,
542 POLICY_LEVEL_MANDATORY,
543 POLICY_SCOPE_MACHINE,
544 DecodeIntegerValue(container.login_screen_idle_action_battery()));
545 }
546
547 if (container.has_login_screen_lid_close_action()) {
548 policies->Set(
549 key::kDeviceLoginScreenLidCloseAction,
550 POLICY_LEVEL_MANDATORY,
551 POLICY_SCOPE_MACHINE,
552 DecodeIntegerValue(container.login_screen_lid_close_action()));
553 }
554
555 if (container.has_login_screen_user_activity_screen_dim_delay_scale()) {
556 policies->Set(
557 key::kDeviceLoginScreenUserActivityScreenDimDelayScale,
558 POLICY_LEVEL_MANDATORY,
559 POLICY_SCOPE_MACHINE,
560 DecodeIntegerValue(
561 container.login_screen_user_activity_screen_dim_delay_scale()));
562 }
563 }
564 }
565
476 void DecodeGenericPolicies(const em::ChromeDeviceSettingsProto& policy, 566 void DecodeGenericPolicies(const em::ChromeDeviceSettingsProto& policy,
477 PolicyMap* policies) { 567 PolicyMap* policies) {
478 if (policy.has_device_policy_refresh_rate()) { 568 if (policy.has_device_policy_refresh_rate()) {
479 const em::DevicePolicyRefreshRateProto& container( 569 const em::DevicePolicyRefreshRateProto& container(
480 policy.device_policy_refresh_rate()); 570 policy.device_policy_refresh_rate());
481 if (container.has_device_policy_refresh_rate()) { 571 if (container.has_device_policy_refresh_rate()) {
482 policies->Set(key::kDevicePolicyRefreshRate, 572 policies->Set(key::kDevicePolicyRefreshRate,
483 POLICY_LEVEL_MANDATORY, 573 POLICY_LEVEL_MANDATORY,
484 POLICY_SCOPE_MACHINE, 574 POLICY_SCOPE_MACHINE,
485 DecodeIntegerValue(container.device_policy_refresh_rate())); 575 DecodeIntegerValue(container.device_policy_refresh_rate()));
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, 674 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy,
585 PolicyMap* policies, 675 PolicyMap* policies,
586 EnterpriseInstallAttributes* install_attributes) { 676 EnterpriseInstallAttributes* install_attributes) {
587 // Decode the various groups of policies. 677 // Decode the various groups of policies.
588 DecodeLoginPolicies(policy, policies); 678 DecodeLoginPolicies(policy, policies);
589 DecodeKioskPolicies(policy, policies, install_attributes); 679 DecodeKioskPolicies(policy, policies, install_attributes);
590 DecodeNetworkPolicies(policy, policies, install_attributes); 680 DecodeNetworkPolicies(policy, policies, install_attributes);
591 DecodeReportingPolicies(policy, policies); 681 DecodeReportingPolicies(policy, policies);
592 DecodeAutoUpdatePolicies(policy, policies); 682 DecodeAutoUpdatePolicies(policy, policies);
593 DecodeAccessibilityPolicies(policy, policies); 683 DecodeAccessibilityPolicies(policy, policies);
684 DecodePowerManagementPolicies(policy, policies);
594 DecodeGenericPolicies(policy, policies); 685 DecodeGenericPolicies(policy, policies);
595 } 686 }
596 687
597 } // namespace policy 688 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698