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/policy/cloud/cloud_external_data_manager.h" | 5 #include "chrome/browser/policy/cloud/cloud_external_data_manager.h" |
6 | 6 |
| 7 #include "chrome/browser/policy/cloud/cloud_policy_store.h" |
| 8 #include "net/url_request/url_request_context_getter.h" |
| 9 |
7 namespace policy { | 10 namespace policy { |
8 | 11 |
9 CloudExternalDataManager::MetadataEntry::MetadataEntry() { | 12 CloudExternalDataManager::MetadataEntry::MetadataEntry() { |
10 } | 13 } |
11 | 14 |
12 CloudExternalDataManager::MetadataEntry::MetadataEntry(const std::string& url, | 15 CloudExternalDataManager::MetadataEntry::MetadataEntry(const std::string& url, |
13 const std::string& hash) | 16 const std::string& hash) |
14 : url(url), | 17 : url(url), |
15 hash(hash) { | 18 hash(hash) { |
16 } | 19 } |
17 | 20 |
| 21 bool CloudExternalDataManager::MetadataEntry::operator!=( |
| 22 const MetadataEntry& other) const { |
| 23 return url != other.url || hash != other.hash; |
| 24 } |
| 25 |
| 26 CloudExternalDataManager::CloudExternalDataManager() : policy_store_(NULL), |
| 27 weak_factory_(this) { |
| 28 } |
| 29 |
| 30 CloudExternalDataManager::~CloudExternalDataManager() { |
| 31 } |
| 32 |
| 33 void CloudExternalDataManager::SetPolicyStore(CloudPolicyStore* policy_store) { |
| 34 policy_store_ = policy_store; |
| 35 if (policy_store_) |
| 36 policy_store_->SetExternalDataManager(weak_factory_.GetWeakPtr()); |
| 37 } |
| 38 |
18 } // namespace policy | 39 } // namespace policy |
OLD | NEW |