| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/profile_policy_connector.h" | 5 #include "chrome/browser/policy/profile_policy_connector.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "components/policy/core/browser/browser_policy_connector.h" | 13 #include "components/policy/core/browser/browser_policy_connector.h" |
| 14 #include "components/policy/core/common/cloud/cloud_policy_core.h" | 14 #include "components/policy/core/common/cloud/cloud_policy_core.h" |
| 15 #include "components/policy/core/common/cloud/cloud_policy_manager.h" | 15 #include "components/policy/core/common/cloud/cloud_policy_manager.h" |
| 16 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 16 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| 17 #include "components/policy/core/common/configuration_policy_provider.h" | 17 #include "components/policy/core/common/configuration_policy_provider.h" |
| 18 #include "components/policy/core/common/forwarding_policy_provider.h" | 18 #include "components/policy/core/common/forwarding_policy_provider.h" |
| 19 #include "components/policy/core/common/policy_service_impl.h" | 19 #include "components/policy/core/common/policy_service_impl.h" |
| 20 #include "google_apis/gaia/gaia_auth_util.h" | 20 #include "google_apis/gaia/gaia_auth_util.h" |
| 21 | 21 |
| 22 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
| 23 #include "chrome/browser/chromeos/login/users/user.h" | |
| 24 #include "chrome/browser/chromeos/login/users/user_manager.h" | 23 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 25 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 24 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 26 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 25 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
| 27 #include "chrome/browser/chromeos/policy/device_local_account_policy_provider.h" | 26 #include "chrome/browser/chromeos/policy/device_local_account_policy_provider.h" |
| 28 #include "chrome/browser/chromeos/policy/login_profile_policy_provider.h" | 27 #include "chrome/browser/chromeos/policy/login_profile_policy_provider.h" |
| 28 #include "components/user_manager/user.h" |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 namespace policy { | 31 namespace policy { |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 bool HasChromePolicy(ConfigurationPolicyProvider* provider, | 35 bool HasChromePolicy(ConfigurationPolicyProvider* provider, |
| 36 const char* name) { | 36 const char* name) { |
| 37 if (!provider) | 37 if (!provider) |
| 38 return false; | 38 return false; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 49 #else | 49 #else |
| 50 : user_cloud_policy_manager_(NULL) | 50 : user_cloud_policy_manager_(NULL) |
| 51 #endif | 51 #endif |
| 52 {} | 52 {} |
| 53 | 53 |
| 54 ProfilePolicyConnector::~ProfilePolicyConnector() {} | 54 ProfilePolicyConnector::~ProfilePolicyConnector() {} |
| 55 | 55 |
| 56 void ProfilePolicyConnector::Init( | 56 void ProfilePolicyConnector::Init( |
| 57 bool force_immediate_load, | 57 bool force_immediate_load, |
| 58 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
| 59 const chromeos::User* user, | 59 const user_manager::User* user, |
| 60 #endif | 60 #endif |
| 61 SchemaRegistry* schema_registry, | 61 SchemaRegistry* schema_registry, |
| 62 CloudPolicyManager* user_cloud_policy_manager) { | 62 CloudPolicyManager* user_cloud_policy_manager) { |
| 63 user_cloud_policy_manager_ = user_cloud_policy_manager; | 63 user_cloud_policy_manager_ = user_cloud_policy_manager; |
| 64 | 64 |
| 65 // |providers| contains a list of the policy providers available for the | 65 // |providers| contains a list of the policy providers available for the |
| 66 // PolicyService of this connector, in decreasing order of priority. | 66 // PolicyService of this connector, in decreasing order of priority. |
| 67 // | 67 // |
| 68 // Note: all the providers appended to this vector must eventually become | 68 // Note: all the providers appended to this vector must eventually become |
| 69 // initialized for every policy domain, otherwise some subsystems will never | 69 // initialized for every policy domain, otherwise some subsystems will never |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 BrowserPolicyConnectorChromeOS* connector = | 174 BrowserPolicyConnectorChromeOS* connector = |
| 175 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 175 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 176 if (HasChromePolicy(connector->GetDeviceCloudPolicyManager(), name)) | 176 if (HasChromePolicy(connector->GetDeviceCloudPolicyManager(), name)) |
| 177 return false; | 177 return false; |
| 178 #endif | 178 #endif |
| 179 | 179 |
| 180 return true; | 180 return true; |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace policy | 183 } // namespace policy |
| OLD | NEW |