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

Unified Diff: chrome/browser/policy/configuration_policy_pref_store.cc

Issue 7147015: Move user cloud policy to BrowserProcess (was 6979011) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit_test include breakage Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/configuration_policy_pref_store.cc
diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc
index b7a29cff9432265c4b22e1f85ac56eb5b41a6d30..ccba75b38e199ff2c7e80dfb03547c1965c254c9 100644
--- a/chrome/browser/policy/configuration_policy_pref_store.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store.cc
@@ -21,11 +21,8 @@
#include "chrome/browser/policy/browser_policy_connector.h"
#include "chrome/browser/policy/configuration_policy_provider.h"
#include "chrome/browser/policy/policy_path_parser.h"
-#include "chrome/browser/policy/profile_policy_connector.h"
-#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/prefs/pref_value_map.h"
#include "chrome/browser/prefs/proxy_config_dictionary.h"
-#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/search_terms_data.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/common/pref_names.h"
@@ -404,11 +401,7 @@ bool ConfigurationPolicyPrefKeeper::ApplyProxyPolicy(
// We only collect the values until we have sufficient information when
// FinalizeProxyPolicySettings() is called to determine whether the presented
// values were correct and apply them in that case.
- if (policy == kPolicyProxyMode ||
- policy == kPolicyProxyServerMode ||
- policy == kPolicyProxyServer ||
- policy == kPolicyProxyPacUrl ||
- policy == kPolicyProxyBypassList) {
+ if (ConfigurationPolicyPrefStore::IsProxyPolicy(policy)) {
delete proxy_policies_[policy];
proxy_policies_[policy] = value;
return true;
@@ -900,20 +893,9 @@ ConfigurationPolicyPrefStore::CreateManagedPlatformPolicyPrefStore() {
// static
ConfigurationPolicyPrefStore*
-ConfigurationPolicyPrefStore::CreateManagedCloudPolicyPrefStore(
- Profile* profile) {
- ConfigurationPolicyProvider* provider = NULL;
- if (profile) {
- // For user policy, return the profile's policy provider.
- provider = policy::ProfilePolicyConnectorFactory::GetForProfile(profile)->
- GetManagedCloudProvider();
- } else {
- // For device policy, return the provider of the browser process.
- BrowserPolicyConnector* connector =
- g_browser_process->browser_policy_connector();
- provider = connector->GetManagedCloudProvider();
- }
- return new ConfigurationPolicyPrefStore(provider);
+ConfigurationPolicyPrefStore::CreateManagedCloudPolicyPrefStore() {
+ return new ConfigurationPolicyPrefStore(
+ g_browser_process->browser_policy_connector()->GetManagedCloudProvider());
}
// static
@@ -927,20 +909,10 @@ ConfigurationPolicyPrefStore::CreateRecommendedPlatformPolicyPrefStore() {
// static
ConfigurationPolicyPrefStore*
-ConfigurationPolicyPrefStore::CreateRecommendedCloudPolicyPrefStore(
- Profile* profile) {
- ConfigurationPolicyProvider* provider = NULL;
- if (profile) {
- // For user policy, return the profile's policy provider.
- provider = policy::ProfilePolicyConnectorFactory::GetForProfile(profile)->
- GetRecommendedCloudProvider();
- } else {
- // For device policy, return the provider of the browser process.
- BrowserPolicyConnector* connector =
- g_browser_process->browser_policy_connector();
- provider = connector->GetRecommendedCloudProvider();
- }
- return new ConfigurationPolicyPrefStore(provider);
+ConfigurationPolicyPrefStore::CreateRecommendedCloudPolicyPrefStore() {
+ return new ConfigurationPolicyPrefStore(
+ g_browser_process->browser_policy_connector()->
+ GetRecommendedCloudProvider());
}
/* static */
@@ -1107,6 +1079,15 @@ ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList() {
return &policy_list;
}
+bool
+ConfigurationPolicyPrefStore::IsProxyPolicy(ConfigurationPolicyType policy) {
+ return policy == kPolicyProxyMode ||
+ policy == kPolicyProxyServerMode ||
+ policy == kPolicyProxyServer ||
+ policy == kPolicyProxyPacUrl ||
+ policy == kPolicyProxyBypassList;
+}
+
ConfigurationPolicyPrefStore::ConfigurationPolicyPrefStore(
ConfigurationPolicyProvider* provider)
: provider_(provider),
« no previous file with comments | « chrome/browser/policy/configuration_policy_pref_store.h ('k') | chrome/browser/policy/configuration_policy_store_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698