| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_pref_store.h" | 5 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 if (ApplyPolicyFromMap(policy, value, kSimplePolicyMap, | 370 if (ApplyPolicyFromMap(policy, value, kSimplePolicyMap, |
| 371 arraysize(kSimplePolicyMap))) | 371 arraysize(kSimplePolicyMap))) |
| 372 return; | 372 return; |
| 373 | 373 |
| 374 // Other policy implementations go here. | 374 // Other policy implementations go here. |
| 375 NOTIMPLEMENTED(); | 375 NOTIMPLEMENTED(); |
| 376 delete value; | 376 delete value; |
| 377 } | 377 } |
| 378 | 378 |
| 379 // static | 379 // static |
| 380 ConfigurationPolicyPrefStore* | 380 scoped_refptr<ConfigurationPolicyPrefStore> |
| 381 ConfigurationPolicyPrefStore::CreateManagedPlatformPolicyPrefStore() { | 381 ConfigurationPolicyPrefStore::CreateManagedPlatformPolicyPrefStore() { |
| 382 return new ConfigurationPolicyPrefStore( | 382 return new ConfigurationPolicyPrefStore( |
| 383 g_configuration_policy_provider_keeper.Get().managed_platform_provider()); | 383 g_configuration_policy_provider_keeper.Get().managed_platform_provider()); |
| 384 } | 384 } |
| 385 | 385 |
| 386 // static | 386 // static |
| 387 ConfigurationPolicyPrefStore* | 387 scoped_refptr<ConfigurationPolicyPrefStore> |
| 388 ConfigurationPolicyPrefStore::CreateDeviceManagementPolicyPrefStore( | 388 ConfigurationPolicyPrefStore::CreateDeviceManagementPolicyPrefStore( |
| 389 Profile* profile) { | 389 Profile* profile) { |
| 390 ConfigurationPolicyProviderKeeper* keeper = | 390 ConfigurationPolicyProviderKeeper* keeper = |
| 391 g_configuration_policy_provider_keeper.Pointer(); | 391 g_configuration_policy_provider_keeper.Pointer(); |
| 392 ConfigurationPolicyProvider* provider = NULL; | 392 ConfigurationPolicyProvider* provider = NULL; |
| 393 if (profile) | 393 if (profile) |
| 394 provider = profile->GetPolicyContext()->GetDeviceManagementPolicyProvider(); | 394 provider = profile->GetPolicyContext()->GetDeviceManagementPolicyProvider(); |
| 395 if (!provider) | 395 if (!provider) |
| 396 provider = keeper->device_management_provider(); | 396 provider = keeper->device_management_provider(); |
| 397 return new ConfigurationPolicyPrefStore(provider); | 397 return new ConfigurationPolicyPrefStore(provider); |
| 398 } | 398 } |
| 399 | 399 |
| 400 // static | 400 // static |
| 401 ConfigurationPolicyPrefStore* | 401 scoped_refptr<ConfigurationPolicyPrefStore> |
| 402 ConfigurationPolicyPrefStore::CreateRecommendedPolicyPrefStore() { | 402 ConfigurationPolicyPrefStore::CreateRecommendedPolicyPrefStore() { |
| 403 return new ConfigurationPolicyPrefStore( | 403 return new ConfigurationPolicyPrefStore( |
| 404 g_configuration_policy_provider_keeper.Get().recommended_provider()); | 404 g_configuration_policy_provider_keeper.Get().recommended_provider()); |
| 405 } | 405 } |
| 406 | 406 |
| 407 // static | 407 // static |
| 408 void ConfigurationPolicyPrefStore::GetProxyPreferenceSet( | 408 void ConfigurationPolicyPrefStore::GetProxyPreferenceSet( |
| 409 ProxyPreferenceSet* proxy_pref_set) { | 409 ProxyPreferenceSet* proxy_pref_set) { |
| 410 proxy_pref_set->clear(); | 410 proxy_pref_set->clear(); |
| 411 for (size_t current = 0; current < arraysize(kProxyPolicyMap); ++current) { | 411 for (size_t current = 0; current < arraysize(kProxyPolicyMap); ++current) { |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 std::string()); | 660 std::string()); |
| 661 return; | 661 return; |
| 662 } | 662 } |
| 663 } | 663 } |
| 664 // Required entries are not there. Remove any related entries. | 664 // Required entries are not there. Remove any related entries. |
| 665 RemovePreferencesOfMap(kDefaultSearchPolicyMap, | 665 RemovePreferencesOfMap(kDefaultSearchPolicyMap, |
| 666 arraysize(kDefaultSearchPolicyMap)); | 666 arraysize(kDefaultSearchPolicyMap)); |
| 667 } | 667 } |
| 668 | 668 |
| 669 } // namespace policy | 669 } // namespace policy |
| OLD | NEW |