Chromium Code Reviews| Index: chrome/browser/policy/configuration_policy_handler.cc |
| diff --git a/chrome/browser/policy/configuration_policy_handler.cc b/chrome/browser/policy/configuration_policy_handler.cc |
| index 5587cae14c2c6582bdbdd08633edf7282a5e7b15..7d78dadfabfc499a4bdc2c2a2b52e39ac351673a 100644 |
| --- a/chrome/browser/policy/configuration_policy_handler.cc |
| +++ b/chrome/browser/policy/configuration_policy_handler.cc |
| @@ -287,6 +287,25 @@ bool StringToIntEnumListPolicyHandler::Convert(const base::Value* input, |
| return true; |
| } |
| +// IntPercentageToDoublePolicyHandler implementation --------------------------- |
| + |
| +IntPercentageToDoublePolicyHandler::IntPercentageToDoublePolicyHandler( |
| + const char* policy_name, |
| + const char* pref_path) |
| + : TypeCheckingPolicyHandler(policy_name, base::Value::TYPE_INTEGER), |
| + pref_path_(pref_path) {} |
|
Mattias Nissler (ping if slow)
2013/02/07 16:52:01
Should this also have a CheckPolicySettings that m
bartfab (slow)
2013/02/07 17:25:53
For the policy in question, the valid range actual
Mattias Nissler (ping if slow)
2013/02/08 09:47:49
It'd be nice to be able to get feedback in about:p
bartfab (slow)
2013/02/08 11:39:24
Done.
|
| + |
| +void IntPercentageToDoublePolicyHandler::ApplyPolicySettings( |
| + const PolicyMap& policies, |
| + PrefValueMap* prefs) { |
| + const base::Value* value = policies.GetValue(policy_name()); |
| + int percentage; |
| + if (value && value->GetAsInteger(&percentage)) { |
| + prefs->SetValue(pref_path_, base::Value::CreateDoubleValue( |
| + static_cast<double>(percentage) / 100.)); |
| + } |
| +} |
| + |
| // ExtensionListPolicyHandler implementation ----------------------------------- |
| ExtensionListPolicyHandler::ExtensionListPolicyHandler(const char* policy_name, |