OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/chromeos/policy/cloud_external_data_policy_observer.h" | 5 #include "chrome/browser/chromeos/policy/cloud_external_data_policy_observer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 void CloudExternalDataPolicyObserver::Delegate::OnExternalDataCleared( | 110 void CloudExternalDataPolicyObserver::Delegate::OnExternalDataCleared( |
111 const std::string& policy, | 111 const std::string& policy, |
112 const std::string& user_id) { | 112 const std::string& user_id) { |
113 } | 113 } |
114 | 114 |
115 void CloudExternalDataPolicyObserver::Delegate::OnExternalDataFetched( | 115 void CloudExternalDataPolicyObserver::Delegate::OnExternalDataFetched( |
116 const std::string& policy, | 116 const std::string& policy, |
117 const std::string& user_id, | 117 const std::string& user_id, |
118 scoped_ptr<std::string> data) { | 118 std::unique_ptr<std::string> data) {} |
119 } | |
120 | 119 |
121 CloudExternalDataPolicyObserver::Delegate::~Delegate() { | 120 CloudExternalDataPolicyObserver::Delegate::~Delegate() { |
122 } | 121 } |
123 | 122 |
124 CloudExternalDataPolicyObserver::CloudExternalDataPolicyObserver( | 123 CloudExternalDataPolicyObserver::CloudExternalDataPolicyObserver( |
125 chromeos::CrosSettings* cros_settings, | 124 chromeos::CrosSettings* cros_settings, |
126 DeviceLocalAccountPolicyService* device_local_account_policy_service, | 125 DeviceLocalAccountPolicyService* device_local_account_policy_service, |
127 const std::string& policy, | 126 const std::string& policy, |
128 Delegate* delegate) | 127 Delegate* delegate) |
129 : cros_settings_(cros_settings), | 128 : cros_settings_(cros_settings), |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 &CloudExternalDataPolicyObserver::OnExternalDataFetched, | 300 &CloudExternalDataPolicyObserver::OnExternalDataFetched, |
302 weak_ptr_factory->GetWeakPtr(), | 301 weak_ptr_factory->GetWeakPtr(), |
303 user_id)); | 302 user_id)); |
304 } else { | 303 } else { |
305 NOTREACHED(); | 304 NOTREACHED(); |
306 } | 305 } |
307 } | 306 } |
308 | 307 |
309 void CloudExternalDataPolicyObserver::OnExternalDataFetched( | 308 void CloudExternalDataPolicyObserver::OnExternalDataFetched( |
310 const std::string& user_id, | 309 const std::string& user_id, |
311 scoped_ptr<std::string> data) { | 310 std::unique_ptr<std::string> data) { |
312 FetchWeakPtrMap::iterator it = fetch_weak_ptrs_.find(user_id); | 311 FetchWeakPtrMap::iterator it = fetch_weak_ptrs_.find(user_id); |
313 DCHECK(it != fetch_weak_ptrs_.end()); | 312 DCHECK(it != fetch_weak_ptrs_.end()); |
314 fetch_weak_ptrs_.erase(it); | 313 fetch_weak_ptrs_.erase(it); |
315 delegate_->OnExternalDataFetched(policy_, user_id, std::move(data)); | 314 delegate_->OnExternalDataFetched(policy_, user_id, std::move(data)); |
316 } | 315 } |
317 | 316 |
318 } // namespace policy | 317 } // namespace policy |
OLD | NEW |