Chromium Code Reviews| 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 "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/policy/configuration_policy_handler.h" | 9 #include "chrome/browser/policy/configuration_policy_handler.h" |
| 10 #include "chrome/browser/policy/policy_error_map.h" | 10 #include "chrome/browser/policy/policy_error_map.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 Value::TYPE_BOOLEAN }, | 71 Value::TYPE_BOOLEAN }, |
| 72 { key::kDisablePrintPreview, | 72 { key::kDisablePrintPreview, |
| 73 prefs::kPrintPreviewDisabled, | 73 prefs::kPrintPreviewDisabled, |
| 74 Value::TYPE_BOOLEAN }, | 74 Value::TYPE_BOOLEAN }, |
| 75 { key::kMetricsReportingEnabled, | 75 { key::kMetricsReportingEnabled, |
| 76 prefs::kMetricsReportingEnabled, | 76 prefs::kMetricsReportingEnabled, |
| 77 Value::TYPE_BOOLEAN }, | 77 Value::TYPE_BOOLEAN }, |
| 78 { key::kApplicationLocaleValue, | 78 { key::kApplicationLocaleValue, |
| 79 prefs::kApplicationLocale, | 79 prefs::kApplicationLocale, |
| 80 Value::TYPE_STRING }, | 80 Value::TYPE_STRING }, |
| 81 { key::kExtensionInstallWhitelist, | |
| 82 prefs::kExtensionInstallAllowList, | |
| 83 Value::TYPE_LIST }, | |
| 84 { key::kExtensionInstallBlacklist, | |
| 85 prefs::kExtensionInstallDenyList, | |
| 86 Value::TYPE_LIST }, | |
| 87 { key::kExtensionInstallForcelist, | 81 { key::kExtensionInstallForcelist, |
|
Joao da Silva
2012/05/03 18:41:22
Why not this one too?
Mattias Nissler (ping if slow)
2012/05/03 20:13:04
Because its format is different: <ID>;<UpdateURL>
| |
| 88 prefs::kExtensionInstallForceList, | 82 prefs::kExtensionInstallForceList, |
| 89 Value::TYPE_LIST }, | 83 Value::TYPE_LIST }, |
| 90 { key::kDisabledPlugins, | 84 { key::kDisabledPlugins, |
| 91 prefs::kPluginsDisabledPlugins, | 85 prefs::kPluginsDisabledPlugins, |
| 92 Value::TYPE_LIST }, | 86 Value::TYPE_LIST }, |
| 93 { key::kDisabledPluginsExceptions, | 87 { key::kDisabledPluginsExceptions, |
| 94 prefs::kPluginsDisabledPluginsExceptions, | 88 prefs::kPluginsDisabledPluginsExceptions, |
| 95 Value::TYPE_LIST }, | 89 Value::TYPE_LIST }, |
| 96 { key::kEnabledPlugins, | 90 { key::kEnabledPlugins, |
| 97 prefs::kPluginsEnabledPlugins, | 91 prefs::kPluginsEnabledPlugins, |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 324 handlers_.push_back(new AutofillPolicyHandler()); | 318 handlers_.push_back(new AutofillPolicyHandler()); |
| 325 handlers_.push_back(new DefaultSearchPolicyHandler()); | 319 handlers_.push_back(new DefaultSearchPolicyHandler()); |
| 326 handlers_.push_back(new DiskCacheDirPolicyHandler()); | 320 handlers_.push_back(new DiskCacheDirPolicyHandler()); |
| 327 handlers_.push_back(new FileSelectionDialogsHandler()); | 321 handlers_.push_back(new FileSelectionDialogsHandler()); |
| 328 handlers_.push_back(new IncognitoModePolicyHandler()); | 322 handlers_.push_back(new IncognitoModePolicyHandler()); |
| 329 handlers_.push_back(new JavascriptPolicyHandler()); | 323 handlers_.push_back(new JavascriptPolicyHandler()); |
| 330 handlers_.push_back(new ProxyPolicyHandler()); | 324 handlers_.push_back(new ProxyPolicyHandler()); |
| 331 handlers_.push_back(new RestoreOnStartupPolicyHandler()); | 325 handlers_.push_back(new RestoreOnStartupPolicyHandler()); |
| 332 handlers_.push_back(new SyncPolicyHandler()); | 326 handlers_.push_back(new SyncPolicyHandler()); |
| 333 | 327 |
| 328 handlers_.push_back( | |
| 329 new ExtensionListPolicyHandler(key::kExtensionInstallWhitelist, | |
| 330 prefs::kExtensionInstallAllowList, | |
| 331 false)); | |
| 332 handlers_.push_back( | |
| 333 new ExtensionListPolicyHandler(key::kExtensionInstallBlacklist, | |
| 334 prefs::kExtensionInstallDenyList, | |
| 335 true)); | |
| 336 | |
| 334 #if !defined(OS_CHROMEOS) | 337 #if !defined(OS_CHROMEOS) |
| 335 handlers_.push_back(new DownloadDirPolicyHandler()); | 338 handlers_.push_back(new DownloadDirPolicyHandler()); |
| 336 #endif // !defined(OS_CHROMEOS) | 339 #endif // !defined(OS_CHROMEOS) |
| 337 | 340 |
| 338 #if defined(OS_CHROMEOS) | 341 #if defined(OS_CHROMEOS) |
| 339 handlers_.push_back( | 342 handlers_.push_back( |
| 340 new NetworkConfigurationPolicyHandler( | 343 new NetworkConfigurationPolicyHandler( |
| 341 key::kDeviceOpenNetworkConfiguration, | 344 key::kDeviceOpenNetworkConfiguration, |
| 342 chromeos::NetworkUIData::ONC_SOURCE_DEVICE_POLICY)); | 345 chromeos::NetworkUIData::ONC_SOURCE_DEVICE_POLICY)); |
| 343 handlers_.push_back( | 346 handlers_.push_back( |
| 344 new NetworkConfigurationPolicyHandler( | 347 new NetworkConfigurationPolicyHandler( |
| 345 key::kOpenNetworkConfiguration, | 348 key::kOpenNetworkConfiguration, |
| 346 chromeos::NetworkUIData::ONC_SOURCE_USER_POLICY)); | 349 chromeos::NetworkUIData::ONC_SOURCE_USER_POLICY)); |
| 350 handlers_.push_back(new PinnedLauncherAppsPolicyHandler()); | |
| 347 #endif // defined(OS_CHROMEOS) | 351 #endif // defined(OS_CHROMEOS) |
| 348 } | 352 } |
| 349 | 353 |
| 350 ConfigurationPolicyHandlerList::~ConfigurationPolicyHandlerList() { | 354 ConfigurationPolicyHandlerList::~ConfigurationPolicyHandlerList() { |
| 351 STLDeleteElements(&handlers_); | 355 STLDeleteElements(&handlers_); |
| 352 } | 356 } |
| 353 | 357 |
| 354 void ConfigurationPolicyHandlerList::ApplyPolicySettings( | 358 void ConfigurationPolicyHandlerList::ApplyPolicySettings( |
| 355 const PolicyMap& policies, | 359 const PolicyMap& policies, |
| 356 PrefValueMap* prefs, | 360 PrefValueMap* prefs, |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 374 } | 378 } |
| 375 | 379 |
| 376 void ConfigurationPolicyHandlerList::PrepareForDisplaying( | 380 void ConfigurationPolicyHandlerList::PrepareForDisplaying( |
| 377 PolicyMap* policies) const { | 381 PolicyMap* policies) const { |
| 378 std::vector<ConfigurationPolicyHandler*>::const_iterator handler; | 382 std::vector<ConfigurationPolicyHandler*>::const_iterator handler; |
| 379 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) | 383 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) |
| 380 (*handler)->PrepareForDisplaying(policies); | 384 (*handler)->PrepareForDisplaying(policies); |
| 381 } | 385 } |
| 382 | 386 |
| 383 } // namespace policy | 387 } // namespace policy |
| OLD | NEW |