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/extensions/api/storage/policy_value_store.h" | 5 #include "chrome/browser/extensions/api/storage/policy_value_store.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 ValueStore::Status ReadOnlyError() { | 23 ValueStore::Status ReadOnlyError() { |
24 return ValueStore::Status(ValueStore::READ_ONLY, | 24 return ValueStore::Status(ValueStore::READ_ONLY, |
25 "This is a read-only store."); | 25 "This is a read-only store."); |
26 } | 26 } |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 PolicyValueStore::PolicyValueStore( | 30 PolicyValueStore::PolicyValueStore( |
31 const std::string& extension_id, | 31 const std::string& extension_id, |
32 const scoped_refptr<SettingsObserverList>& observers, | 32 const scoped_refptr<SettingsObserverList>& observers, |
33 scoped_ptr<ValueStore> delegate) | 33 std::unique_ptr<ValueStore> delegate) |
34 : extension_id_(extension_id), | 34 : extension_id_(extension_id), |
35 observers_(observers), | 35 observers_(observers), |
36 delegate_(std::move(delegate)) {} | 36 delegate_(std::move(delegate)) {} |
37 | 37 |
38 PolicyValueStore::~PolicyValueStore() {} | 38 PolicyValueStore::~PolicyValueStore() {} |
39 | 39 |
40 void PolicyValueStore::SetCurrentPolicy(const policy::PolicyMap& policy) { | 40 void PolicyValueStore::SetCurrentPolicy(const policy::PolicyMap& policy) { |
41 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 41 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
42 // Convert |policy| to a dictionary value. Only include mandatory policies | 42 // Convert |policy| to a dictionary value. Only include mandatory policies |
43 // for now. | 43 // for now. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 ValueStore::WriteResult PolicyValueStore::Remove( | 153 ValueStore::WriteResult PolicyValueStore::Remove( |
154 const std::vector<std::string>& keys) { | 154 const std::vector<std::string>& keys) { |
155 return MakeWriteResult(ReadOnlyError()); | 155 return MakeWriteResult(ReadOnlyError()); |
156 } | 156 } |
157 | 157 |
158 ValueStore::WriteResult PolicyValueStore::Clear() { | 158 ValueStore::WriteResult PolicyValueStore::Clear() { |
159 return MakeWriteResult(ReadOnlyError()); | 159 return MakeWriteResult(ReadOnlyError()); |
160 } | 160 } |
161 | 161 |
162 } // namespace extensions | 162 } // namespace extensions |
OLD | NEW |