OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/policy/async_policy_provider.h" | 16 #include "chrome/browser/policy/async_policy_provider.h" |
17 #include "chrome/browser/policy/cloud_policy_client.h" | 17 #include "chrome/browser/policy/cloud_policy_client.h" |
18 #include "chrome/browser/policy/cloud_policy_service.h" | 18 #include "chrome/browser/policy/cloud_policy_service.h" |
19 #include "chrome/browser/policy/configuration_policy_provider.h" | 19 #include "chrome/browser/policy/configuration_policy_provider.h" |
20 #include "chrome/browser/policy/device_management_service.h" | 20 #include "chrome/browser/policy/device_management_service.h" |
21 #include "chrome/browser/policy/managed_mode_policy_provider.h" | 21 #include "chrome/browser/policy/managed_mode_policy_provider.h" |
22 #include "chrome/browser/policy/policy_service_impl.h" | 22 #include "chrome/browser/policy/policy_service_impl.h" |
23 #include "chrome/browser/policy/policy_statistics_collector.h" | 23 #include "chrome/browser/policy/policy_statistics_collector.h" |
| 24 #include "chrome/browser/prefs/pref_registry_simple.h" |
24 #include "chrome/browser/prefs/pref_service.h" | 25 #include "chrome/browser/prefs/pref_service.h" |
25 #include "chrome/browser/prefs/pref_service_simple.h" | |
26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/common/chrome_paths.h" | 27 #include "chrome/common/chrome_paths.h" |
28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
30 #include "google_apis/gaia/gaia_auth_util.h" | 30 #include "google_apis/gaia/gaia_auth_util.h" |
31 #include "google_apis/gaia/gaia_constants.h" | 31 #include "google_apis/gaia/gaia_constants.h" |
32 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
33 #include "policy/policy_constants.h" | 33 #include "policy/policy_constants.h" |
34 #include "third_party/icu/public/i18n/unicode/regex.h" | 34 #include "third_party/icu/public/i18n/unicode/regex.h" |
35 | 35 |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 UTF8ToUTF16(gaia::ExtractDomainName(gaia::CanonicalizeEmail(username))); | 398 UTF8ToUTF16(gaia::ExtractDomainName(gaia::CanonicalizeEmail(username))); |
399 for (size_t i = 0; i < arraysize(kNonManagedDomainPatterns); i++) { | 399 for (size_t i = 0; i < arraysize(kNonManagedDomainPatterns); i++) { |
400 string16 pattern = WideToUTF16(kNonManagedDomainPatterns[i]); | 400 string16 pattern = WideToUTF16(kNonManagedDomainPatterns[i]); |
401 if (MatchDomain(domain, pattern)) | 401 if (MatchDomain(domain, pattern)) |
402 return true; | 402 return true; |
403 } | 403 } |
404 return false; | 404 return false; |
405 } | 405 } |
406 | 406 |
407 // static | 407 // static |
408 void BrowserPolicyConnector::RegisterPrefs(PrefServiceSimple* local_state) { | 408 void BrowserPolicyConnector::RegisterPrefs(PrefRegistrySimple* registry) { |
409 local_state->RegisterIntegerPref(prefs::kUserPolicyRefreshRate, | 409 registry->RegisterIntegerPref(prefs::kUserPolicyRefreshRate, |
410 kDefaultPolicyRefreshRateMs); | 410 kDefaultPolicyRefreshRateMs); |
411 #if defined(OS_CHROMEOS) | 411 #if defined(OS_CHROMEOS) |
412 local_state->RegisterIntegerPref(prefs::kDevicePolicyRefreshRate, | 412 registry->RegisterIntegerPref(prefs::kDevicePolicyRefreshRate, |
413 kDefaultPolicyRefreshRateMs); | 413 kDefaultPolicyRefreshRateMs); |
414 #endif | 414 #endif |
415 } | 415 } |
416 | 416 |
417 void BrowserPolicyConnector::CompleteInitialization() { | 417 void BrowserPolicyConnector::CompleteInitialization() { |
418 if (g_testing_provider) | 418 if (g_testing_provider) |
419 g_testing_provider->Init(); | 419 g_testing_provider->Init(); |
420 if (platform_provider_) | 420 if (platform_provider_) |
421 platform_provider_->Init(); | 421 platform_provider_->Init(); |
422 | 422 |
423 #if defined(OS_CHROMEOS) | 423 #if defined(OS_CHROMEOS) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 return new AsyncPolicyProvider(loader.Pass()); | 527 return new AsyncPolicyProvider(loader.Pass()); |
528 } else { | 528 } else { |
529 return NULL; | 529 return NULL; |
530 } | 530 } |
531 #else | 531 #else |
532 return NULL; | 532 return NULL; |
533 #endif | 533 #endif |
534 } | 534 } |
535 | 535 |
536 } // namespace policy | 536 } // namespace policy |
OLD | NEW |