Index: chrome/browser/policy/profile_policy_context.cc |
diff --git a/chrome/browser/policy/profile_policy_context.cc b/chrome/browser/policy/profile_policy_context.cc |
index 7adffd3e8c562d46b44e42967003df0bc8ebee5c..28bf5b01688fad1548427b3b66f4590ca9cc6148 100644 |
--- a/chrome/browser/policy/profile_policy_context.cc |
+++ b/chrome/browser/policy/profile_policy_context.cc |
@@ -2,6 +2,9 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include <algorithm> |
+#include <string> |
+ |
#include "base/command_line.h" |
#include "chrome/browser/policy/configuration_policy_pref_store.h" |
#include "chrome/browser/policy/device_management_policy_provider.h" |
@@ -20,21 +23,31 @@ namespace { |
const int64 kPolicyRefreshRateMinMs = 30 * 60 * 1000; // 30 minutes |
const int64 kPolicyRefreshRateMaxMs = 24 * 60 * 60 * 1000; // 1 day |
-} |
+} // namespace |
namespace policy { |
ProfilePolicyContext::ProfilePolicyContext(Profile* profile) |
: profile_(profile) { |
CommandLine* command_line = CommandLine::ForCurrentProcess(); |
- if (command_line->HasSwitch(switches::kDeviceManagementUrl)) { |
+ if (command_line->HasSwitch(switches::kCloudPolicyUrl)) { |
+ device_management_service_.reset(new DeviceManagementService( |
+ command_line->GetSwitchValueASCII(switches::kCloudPolicyUrl))); |
+ device_management_policy_provider_.reset( |
+ new policy::DeviceManagementPolicyProvider( |
+ ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(), |
+ device_management_service_->CreateBackend(), |
+ profile_, |
+ true)); |
+ } else if (command_line->HasSwitch(switches::kDeviceManagementUrl)) { |
device_management_service_.reset(new DeviceManagementService( |
command_line->GetSwitchValueASCII(switches::kDeviceManagementUrl))); |
device_management_policy_provider_.reset( |
new policy::DeviceManagementPolicyProvider( |
ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(), |
device_management_service_->CreateBackend(), |
- profile_)); |
+ profile_, |
+ false)); |
} |
} |