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

Side by Side Diff: chrome/browser/policy/configuration_policy_handler_list.cc

Issue 12217068: Add policies to control Chrome OS power management (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/policy/configuration_policy_handler_list.h" 5 #include "chrome/browser/policy/configuration_policy_handler_list.h"
6 6
7 #include "base/prefs/pref_value_map.h" 7 #include "base/prefs/pref_value_map.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/policy/configuration_policy_handler.h" 10 #include "chrome/browser/policy/configuration_policy_handler.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 Value::TYPE_BOOLEAN }, 339 Value::TYPE_BOOLEAN },
340 { key::kShowLogoutButtonInTray, 340 { key::kShowLogoutButtonInTray,
341 prefs::kShowLogoutButtonInTray, 341 prefs::kShowLogoutButtonInTray,
342 Value::TYPE_BOOLEAN }, 342 Value::TYPE_BOOLEAN },
343 { key::kShelfAutoHideBehavior, 343 { key::kShelfAutoHideBehavior,
344 prefs::kShelfAutoHideBehaviorLocal, 344 prefs::kShelfAutoHideBehaviorLocal,
345 Value::TYPE_STRING }, 345 Value::TYPE_STRING },
346 { key::kSessionLengthLimit, 346 { key::kSessionLengthLimit,
347 prefs::kSessionLengthLimit, 347 prefs::kSessionLengthLimit,
348 Value::TYPE_INTEGER }, 348 Value::TYPE_INTEGER },
349 { key::kScreenDimDelayAC,
350 prefs::kPowerAcScreenDimDelayMs,
351 Value::TYPE_INTEGER },
352 { key::kScreenOffDelayAC,
353 prefs::kPowerAcScreenOffDelayMs,
354 Value::TYPE_INTEGER },
355 { key::kScreenLockDelayAC,
356 prefs::kPowerAcScreenLockDelayMs,
357 Value::TYPE_INTEGER },
358 { key::kIdleDelayAC,
359 prefs::kPowerAcIdleDelayMs,
360 Value::TYPE_INTEGER },
361 { key::kScreenDimDelayBattery,
362 prefs::kPowerBatteryScreenDimDelayMs,
363 Value::TYPE_INTEGER },
364 { key::kScreenOffDelayBattery,
365 prefs::kPowerBatteryScreenOffDelayMs,
366 Value::TYPE_INTEGER },
367 { key::kScreenLockDelayBattery,
368 prefs::kPowerBatteryScreenLockDelayMs,
369 Value::TYPE_INTEGER },
370 { key::kIdleDelayBattery,
371 prefs::kPowerBatteryIdleDelayMs,
372 Value::TYPE_INTEGER },
373 { key::kIdleAction,
374 prefs::kPowerIdleAction,
375 Value::TYPE_INTEGER },
376 { key::kLidCloseAction,
377 prefs::kPowerLidClosedAction,
378 Value::TYPE_INTEGER },
379 { key::kPowerManagementUsesAudioActivity,
380 prefs::kPowerUseAudioActivity,
381 Value::TYPE_BOOLEAN },
382 { key::kPowerManagementUsesVideoActivity,
383 prefs::kPowerUseVideoActivity,
384 Value::TYPE_BOOLEAN },
349 #endif // defined(OS_CHROMEOS) 385 #endif // defined(OS_CHROMEOS)
350 386
351 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) 387 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS)
352 { key::kBackgroundModeEnabled, 388 { key::kBackgroundModeEnabled,
353 prefs::kBackgroundModeEnabled, 389 prefs::kBackgroundModeEnabled,
354 Value::TYPE_BOOLEAN }, 390 Value::TYPE_BOOLEAN },
355 #endif // !defined(OS_MACOSX) && !defined(OS_CHROMEOS) 391 #endif // !defined(OS_MACOSX) && !defined(OS_CHROMEOS)
356 }; 392 };
357 393
358 // Mapping from extension type names to Manifest::Type. 394 // Mapping from extension type names to Manifest::Type.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 #if defined(OS_CHROMEOS) 448 #if defined(OS_CHROMEOS)
413 handlers_.push_back( 449 handlers_.push_back(
414 new NetworkConfigurationPolicyHandler( 450 new NetworkConfigurationPolicyHandler(
415 key::kDeviceOpenNetworkConfiguration, 451 key::kDeviceOpenNetworkConfiguration,
416 chromeos::onc::ONC_SOURCE_DEVICE_POLICY)); 452 chromeos::onc::ONC_SOURCE_DEVICE_POLICY));
417 handlers_.push_back( 453 handlers_.push_back(
418 new NetworkConfigurationPolicyHandler( 454 new NetworkConfigurationPolicyHandler(
419 key::kOpenNetworkConfiguration, 455 key::kOpenNetworkConfiguration,
420 chromeos::onc::ONC_SOURCE_USER_POLICY)); 456 chromeos::onc::ONC_SOURCE_USER_POLICY));
421 handlers_.push_back(new PinnedLauncherAppsPolicyHandler()); 457 handlers_.push_back(new PinnedLauncherAppsPolicyHandler());
458
459 handlers_.push_back(
460 new IntPercentageToDoublePolicyHandler(
461 key::kPresentationIdleDelayScale,
462 prefs::kPowerPresentationIdleDelayFactor));
422 #endif // defined(OS_CHROMEOS) 463 #endif // defined(OS_CHROMEOS)
423 } 464 }
424 465
425 ConfigurationPolicyHandlerList::~ConfigurationPolicyHandlerList() { 466 ConfigurationPolicyHandlerList::~ConfigurationPolicyHandlerList() {
426 STLDeleteElements(&handlers_); 467 STLDeleteElements(&handlers_);
427 } 468 }
428 469
429 void ConfigurationPolicyHandlerList::ApplyPolicySettings( 470 void ConfigurationPolicyHandlerList::ApplyPolicySettings(
430 const PolicyMap& policies, 471 const PolicyMap& policies,
431 PrefValueMap* prefs, 472 PrefValueMap* prefs,
(...skipping 17 matching lines...) Expand all
449 } 490 }
450 491
451 void ConfigurationPolicyHandlerList::PrepareForDisplaying( 492 void ConfigurationPolicyHandlerList::PrepareForDisplaying(
452 PolicyMap* policies) const { 493 PolicyMap* policies) const {
453 std::vector<ConfigurationPolicyHandler*>::const_iterator handler; 494 std::vector<ConfigurationPolicyHandler*>::const_iterator handler;
454 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) 495 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler)
455 (*handler)->PrepareForDisplaying(policies); 496 (*handler)->PrepareForDisplaying(policies);
456 } 497 }
457 498
458 } // namespace policy 499 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698