| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/prefs/pref_registry_simple.h" | 17 #include "base/prefs/pref_registry_simple.h" |
| 18 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
| 19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 20 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 21 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 22 #include "chrome/browser/policy/async_policy_provider.h" | 22 #include "chrome/browser/policy/async_policy_provider.h" |
| 23 #include "chrome/browser/policy/cloud/cloud_policy_client.h" | 23 #include "chrome/browser/policy/cloud/cloud_policy_client.h" |
| 24 #include "chrome/browser/policy/cloud/cloud_policy_service.h" | 24 #include "chrome/browser/policy/cloud/cloud_policy_service.h" |
| 25 #include "chrome/browser/policy/cloud/device_management_service.h" | 25 #include "chrome/browser/policy/cloud/device_management_service.h" |
| 26 #include "chrome/browser/policy/configuration_policy_provider.h" | 26 #include "chrome/browser/policy/configuration_policy_provider.h" |
| 27 #include "chrome/browser/policy/managed_mode_policy_provider.h" | 27 #include "chrome/browser/policy/managed_mode_policy_provider.h" |
| 28 #include "chrome/browser/policy/policy_domain_descriptor.h" | 28 #include "chrome/browser/policy/policy_domain_descriptor.h" |
| 29 #include "chrome/browser/policy/policy_manifest_handler.h" |
| 29 #include "chrome/browser/policy/policy_service_impl.h" | 30 #include "chrome/browser/policy/policy_service_impl.h" |
| 30 #include "chrome/browser/policy/policy_statistics_collector.h" | 31 #include "chrome/browser/policy/policy_statistics_collector.h" |
| 31 #include "chrome/common/chrome_paths.h" | 32 #include "chrome/common/chrome_paths.h" |
| 32 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
| 34 #include "content/public/browser/browser_thread.h" | 35 #include "content/public/browser/browser_thread.h" |
| 35 #include "google_apis/gaia/gaia_auth_util.h" | 36 #include "google_apis/gaia/gaia_auth_util.h" |
| 36 #include "google_apis/gaia/gaia_constants.h" | 37 #include "google_apis/gaia/gaia_constants.h" |
| 37 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
| 38 #include "net/url_request/url_request_context_getter.h" | 39 #include "net/url_request/url_request_context_getter.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 SetTimezoneIfPolicyAvailable(); | 200 SetTimezoneIfPolicyAvailable(); |
| 200 #endif | 201 #endif |
| 201 | 202 |
| 202 policy_statistics_collector_.reset( | 203 policy_statistics_collector_.reset( |
| 203 new policy::PolicyStatisticsCollector( | 204 new policy::PolicyStatisticsCollector( |
| 204 GetPolicyService(), | 205 GetPolicyService(), |
| 205 local_state_, | 206 local_state_, |
| 206 MessageLoop::current()->message_loop_proxy())); | 207 MessageLoop::current()->message_loop_proxy())); |
| 207 policy_statistics_collector_->Initialize(); | 208 policy_statistics_collector_->Initialize(); |
| 208 | 209 |
| 210 (new PolicyManifestHandler)->Register(); |
| 211 |
| 209 is_initialized_ = true; | 212 is_initialized_ = true; |
| 210 } | 213 } |
| 211 | 214 |
| 212 void BrowserPolicyConnector::Shutdown() { | 215 void BrowserPolicyConnector::Shutdown() { |
| 213 is_initialized_ = false; | 216 is_initialized_ = false; |
| 214 | 217 |
| 215 if (g_testing_provider) | 218 if (g_testing_provider) |
| 216 g_testing_provider->Shutdown(); | 219 g_testing_provider->Shutdown(); |
| 217 // Drop g_testing_provider so that tests executed with --single_process can | 220 // Drop g_testing_provider so that tests executed with --single_process can |
| 218 // call SetPolicyProviderForTesting() again. It is still owned by the test. | 221 // call SetPolicyProviderForTesting() again. It is still owned by the test. |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 return new AsyncPolicyProvider(loader.Pass()); | 490 return new AsyncPolicyProvider(loader.Pass()); |
| 488 } else { | 491 } else { |
| 489 return NULL; | 492 return NULL; |
| 490 } | 493 } |
| 491 #else | 494 #else |
| 492 return NULL; | 495 return NULL; |
| 493 #endif | 496 #endif |
| 494 } | 497 } |
| 495 | 498 |
| 496 } // namespace policy | 499 } // namespace policy |
| OLD | NEW |