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/content_settings/content_settings_store.
h" | 5 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 ContentSettingsType type, | 102 ContentSettingsType type, |
103 const content_settings::ResourceIdentifier& identifier, | 103 const content_settings::ResourceIdentifier& identifier, |
104 ContentSetting setting, | 104 ContentSetting setting, |
105 ExtensionPrefsScope scope) { | 105 ExtensionPrefsScope scope) { |
106 { | 106 { |
107 base::AutoLock lock(lock_); | 107 base::AutoLock lock(lock_); |
108 OriginIdentifierValueMap* map = GetValueMap(ext_id, scope); | 108 OriginIdentifierValueMap* map = GetValueMap(ext_id, scope); |
109 if (setting == CONTENT_SETTING_DEFAULT) { | 109 if (setting == CONTENT_SETTING_DEFAULT) { |
110 map->DeleteValue(primary_pattern, secondary_pattern, type, identifier); | 110 map->DeleteValue(primary_pattern, secondary_pattern, type, identifier); |
111 } else { | 111 } else { |
| 112 // Do not set a timestamp for extension settings. |
112 map->SetValue(primary_pattern, secondary_pattern, type, identifier, | 113 map->SetValue(primary_pattern, secondary_pattern, type, identifier, |
113 new base::Value(setting)); | 114 base::Time(), new base::Value(setting)); |
114 } | 115 } |
115 } | 116 } |
116 | 117 |
117 // Send notification that content settings changed. (Note: This is responsible | 118 // Send notification that content settings changed. (Note: This is responsible |
118 // for updating the pref store, so cannot be skipped even if the setting would | 119 // for updating the pref store, so cannot be skipped even if the setting would |
119 // be masked by another extension.) | 120 // be masked by another extension.) |
120 NotifyOfContentSettingChanged(ext_id, | 121 NotifyOfContentSettingChanged(ext_id, |
121 scope != kExtensionPrefsScopeRegular); | 122 scope != kExtensionPrefsScopeRegular); |
122 } | 123 } |
123 | 124 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 384 |
384 ContentSettingsStore::ExtensionEntries::iterator | 385 ContentSettingsStore::ExtensionEntries::iterator |
385 ContentSettingsStore::FindIterator(const std::string& ext_id) { | 386 ContentSettingsStore::FindIterator(const std::string& ext_id) { |
386 return std::find_if(entries_.begin(), entries_.end(), | 387 return std::find_if(entries_.begin(), entries_.end(), |
387 [ext_id](const std::unique_ptr<ExtensionEntry>& entry) { | 388 [ext_id](const std::unique_ptr<ExtensionEntry>& entry) { |
388 return entry->id == ext_id; | 389 return entry->id == ext_id; |
389 }); | 390 }); |
390 } | 391 } |
391 | 392 |
392 } // namespace extensions | 393 } // namespace extensions |
OLD | NEW |