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/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 scoped_ptr<CloudPolicyStore> store, | 53 scoped_ptr<CloudPolicyStore> store, |
54 scoped_ptr<CloudExternalDataManager> external_data_manager, | 54 scoped_ptr<CloudExternalDataManager> external_data_manager, |
55 const base::FilePath& component_policy_cache_path, | 55 const base::FilePath& component_policy_cache_path, |
56 bool wait_for_policy_fetch, | 56 bool wait_for_policy_fetch, |
57 base::TimeDelta initial_policy_fetch_timeout, | 57 base::TimeDelta initial_policy_fetch_timeout, |
58 const scoped_refptr<base::SequencedTaskRunner>& task_runner, | 58 const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
59 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, | 59 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, |
60 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) | 60 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) |
61 : CloudPolicyManager( | 61 : CloudPolicyManager( |
62 PolicyNamespaceKey(dm_protocol::kChromeUserPolicyType, std::string()), | 62 PolicyNamespaceKey(dm_protocol::kChromeUserPolicyType, std::string()), |
| 63 kPolicyVerificationKeyHash, |
63 store.get(), | 64 store.get(), |
64 task_runner, | 65 task_runner, |
65 file_task_runner, | 66 file_task_runner, |
66 io_task_runner), | 67 io_task_runner), |
67 store_(store.Pass()), | 68 store_(store.Pass()), |
68 external_data_manager_(external_data_manager.Pass()), | 69 external_data_manager_(external_data_manager.Pass()), |
69 component_policy_cache_path_(component_policy_cache_path), | 70 component_policy_cache_path_(component_policy_cache_path), |
70 wait_for_policy_fetch_(wait_for_policy_fetch), | 71 wait_for_policy_fetch_(wait_for_policy_fetch), |
71 policy_fetch_timeout_(false, false) { | 72 policy_fetch_timeout_(false, false) { |
72 time_init_started_ = base::Time::Now(); | 73 time_init_started_ = base::Time::Now(); |
(...skipping 23 matching lines...) Expand all Loading... |
96 // from the Profile because Connect() is called before the profile is | 97 // from the Profile because Connect() is called before the profile is |
97 // fully initialized (required so we can perform the initial policy load). | 98 // fully initialized (required so we can perform the initial policy load). |
98 // TODO(atwilson): Change this to use a UserPolicyRequestContext once | 99 // TODO(atwilson): Change this to use a UserPolicyRequestContext once |
99 // Connect() is called after profile initialization. http://crbug.com/323591 | 100 // Connect() is called after profile initialization. http://crbug.com/323591 |
100 request_context = new SystemPolicyRequestContext( | 101 request_context = new SystemPolicyRequestContext( |
101 system_request_context, | 102 system_request_context, |
102 content::GetUserAgent(GURL( | 103 content::GetUserAgent(GURL( |
103 device_management_service->GetServerUrl()))); | 104 device_management_service->GetServerUrl()))); |
104 } | 105 } |
105 scoped_ptr<CloudPolicyClient> cloud_policy_client( | 106 scoped_ptr<CloudPolicyClient> cloud_policy_client( |
106 new CloudPolicyClient(std::string(), std::string(), user_affiliation, | 107 new CloudPolicyClient(std::string(), std::string(), |
| 108 kPolicyVerificationKeyHash, user_affiliation, |
107 NULL, device_management_service, | 109 NULL, device_management_service, |
108 request_context)); | 110 request_context)); |
109 core()->Connect(cloud_policy_client.Pass()); | 111 core()->Connect(cloud_policy_client.Pass()); |
110 client()->AddObserver(this); | 112 client()->AddObserver(this); |
111 | 113 |
112 external_data_manager_->Connect(request_context); | 114 external_data_manager_->Connect(request_context); |
113 | 115 |
114 CreateComponentCloudPolicyService(component_policy_cache_path_, | 116 CreateComponentCloudPolicyService(component_policy_cache_path_, |
115 request_context); | 117 request_context); |
116 | 118 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 // OnComponentCloudPolicyUpdated() once it's ready. | 344 // OnComponentCloudPolicyUpdated() once it's ready. |
343 return; | 345 return; |
344 } | 346 } |
345 | 347 |
346 core()->StartRefreshScheduler(); | 348 core()->StartRefreshScheduler(); |
347 core()->TrackRefreshDelayPref(local_state_, | 349 core()->TrackRefreshDelayPref(local_state_, |
348 policy_prefs::kUserPolicyRefreshRate); | 350 policy_prefs::kUserPolicyRefreshRate); |
349 } | 351 } |
350 | 352 |
351 } // namespace policy | 353 } // namespace policy |
OLD | NEW |