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. |
| 113 base::Time last_modified; |
112 map->SetValue(primary_pattern, secondary_pattern, type, identifier, | 114 map->SetValue(primary_pattern, secondary_pattern, type, identifier, |
113 new base::Value(setting)); | 115 last_modified, new base::Value(setting)); |
114 } | 116 } |
115 } | 117 } |
116 | 118 |
117 // Send notification that content settings changed. (Note: This is responsible | 119 // 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 | 120 // for updating the pref store, so cannot be skipped even if the setting would |
119 // be masked by another extension.) | 121 // be masked by another extension.) |
120 NotifyOfContentSettingChanged(ext_id, | 122 NotifyOfContentSettingChanged(ext_id, |
121 scope != kExtensionPrefsScopeRegular); | 123 scope != kExtensionPrefsScopeRegular); |
122 } | 124 } |
123 | 125 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 385 |
384 ContentSettingsStore::ExtensionEntries::iterator | 386 ContentSettingsStore::ExtensionEntries::iterator |
385 ContentSettingsStore::FindIterator(const std::string& ext_id) { | 387 ContentSettingsStore::FindIterator(const std::string& ext_id) { |
386 return std::find_if(entries_.begin(), entries_.end(), | 388 return std::find_if(entries_.begin(), entries_.end(), |
387 [ext_id](const std::unique_ptr<ExtensionEntry>& entry) { | 389 [ext_id](const std::unique_ptr<ExtensionEntry>& entry) { |
388 return entry->id == ext_id; | 390 return entry->id == ext_id; |
389 }); | 391 }); |
390 } | 392 } |
391 | 393 |
392 } // namespace extensions | 394 } // namespace extensions |
OLD | NEW |