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

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

Issue 6409040: New policy protobuf protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review! Created 9 years, 11 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/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));
}
}

Powered by Google App Engine
This is Rietveld 408576698