| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const content_settings::ResourceIdentifier& identifier, | 98 const content_settings::ResourceIdentifier& identifier, |
| 99 ContentSetting setting, | 99 ContentSetting setting, |
| 100 ExtensionPrefsScope scope) { | 100 ExtensionPrefsScope scope) { |
| 101 { | 101 { |
| 102 base::AutoLock lock(lock_); | 102 base::AutoLock lock(lock_); |
| 103 OriginIdentifierValueMap* map = GetValueMap(ext_id, scope); | 103 OriginIdentifierValueMap* map = GetValueMap(ext_id, scope); |
| 104 if (setting == CONTENT_SETTING_DEFAULT) { | 104 if (setting == CONTENT_SETTING_DEFAULT) { |
| 105 map->DeleteValue(primary_pattern, secondary_pattern, type, identifier); | 105 map->DeleteValue(primary_pattern, secondary_pattern, type, identifier); |
| 106 } else { | 106 } else { |
| 107 map->SetValue(primary_pattern, secondary_pattern, type, identifier, | 107 map->SetValue(primary_pattern, secondary_pattern, type, identifier, |
| 108 base::Value::CreateIntegerValue(setting)); | 108 new base::FundamentalValue(setting)); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 // Send notification that content settings changed. | 112 // Send notification that content settings changed. |
| 113 // TODO(markusheintz): Notifications should only be sent if the set content | 113 // TODO(markusheintz): Notifications should only be sent if the set content |
| 114 // setting is effective and not hidden by another setting of another | 114 // setting is effective and not hidden by another setting of another |
| 115 // extension installed more recently. | 115 // extension installed more recently. |
| 116 NotifyOfContentSettingChanged(ext_id, | 116 NotifyOfContentSettingChanged(ext_id, |
| 117 scope != kExtensionPrefsScopeRegular); | 117 scope != kExtensionPrefsScopeRegular); |
| 118 } | 118 } |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 ContentSettingsStore::FindEntry(const std::string& ext_id) const { | 367 ContentSettingsStore::FindEntry(const std::string& ext_id) const { |
| 368 ExtensionEntryMap::const_iterator i; | 368 ExtensionEntryMap::const_iterator i; |
| 369 for (i = entries_.begin(); i != entries_.end(); ++i) { | 369 for (i = entries_.begin(); i != entries_.end(); ++i) { |
| 370 if (i->second->id == ext_id) | 370 if (i->second->id == ext_id) |
| 371 return i; | 371 return i; |
| 372 } | 372 } |
| 373 return entries_.end(); | 373 return entries_.end(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace extensions | 376 } // namespace extensions |
| OLD | NEW |