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

Side by Side Diff: components/policy/core/browser/browser_policy_connector.cc

Issue 818103002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/policy/core/browser/browser_policy_connector.h" 5 #include "components/policy/core/browser/browser_policy_connector.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 for (size_t i = 0; i < arraysize(kNonManagedDomainPatterns); i++) { 227 for (size_t i = 0; i < arraysize(kNonManagedDomainPatterns); i++) {
228 base::string16 pattern = base::WideToUTF16(kNonManagedDomainPatterns[i]); 228 base::string16 pattern = base::WideToUTF16(kNonManagedDomainPatterns[i]);
229 if (MatchDomain(domain, pattern, i)) 229 if (MatchDomain(domain, pattern, i))
230 return true; 230 return true;
231 } 231 }
232 return false; 232 return false;
233 } 233 }
234 234
235 // static 235 // static
236 std::string BrowserPolicyConnector::GetDeviceManagementUrl() { 236 std::string BrowserPolicyConnector::GetDeviceManagementUrl() {
237 CommandLine* command_line = CommandLine::ForCurrentProcess(); 237 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
238 if (command_line->HasSwitch(switches::kDeviceManagementUrl)) 238 if (command_line->HasSwitch(switches::kDeviceManagementUrl))
239 return command_line->GetSwitchValueASCII(switches::kDeviceManagementUrl); 239 return command_line->GetSwitchValueASCII(switches::kDeviceManagementUrl);
240 else 240 else
241 return kDefaultDeviceManagementServerUrl; 241 return kDefaultDeviceManagementServerUrl;
242 } 242 }
243 243
244 // static 244 // static
245 void BrowserPolicyConnector::RegisterPrefs(PrefRegistrySimple* registry) { 245 void BrowserPolicyConnector::RegisterPrefs(PrefRegistrySimple* registry) {
246 registry->RegisterIntegerPref( 246 registry->RegisterIntegerPref(
247 policy_prefs::kUserPolicyRefreshRate, 247 policy_prefs::kUserPolicyRefreshRate,
248 CloudPolicyRefreshScheduler::kDefaultRefreshDelayMs); 248 CloudPolicyRefreshScheduler::kDefaultRefreshDelayMs);
249 } 249 }
250 250
251 void BrowserPolicyConnector::AddPolicyProvider( 251 void BrowserPolicyConnector::AddPolicyProvider(
252 scoped_ptr<ConfigurationPolicyProvider> provider) { 252 scoped_ptr<ConfigurationPolicyProvider> provider) {
253 policy_providers_.push_back(provider.release()); 253 policy_providers_.push_back(provider.release());
254 } 254 }
255 255
256 void BrowserPolicyConnector::SetPlatformPolicyProvider( 256 void BrowserPolicyConnector::SetPlatformPolicyProvider(
257 scoped_ptr<ConfigurationPolicyProvider> provider) { 257 scoped_ptr<ConfigurationPolicyProvider> provider) {
258 CHECK(!platform_policy_provider_); 258 CHECK(!platform_policy_provider_);
259 platform_policy_provider_ = provider.get(); 259 platform_policy_provider_ = provider.get();
260 AddPolicyProvider(provider.Pass()); 260 AddPolicyProvider(provider.Pass());
261 } 261 }
262 262
263 } // namespace policy 263 } // namespace policy
OLDNEW
« no previous file with comments | « components/password_manager/core/common/experiments.cc ('k') | components/policy/core/common/cloud/cloud_policy_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698