Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: chrome/browser/extensions/api/content_settings/content_settings_store.cc

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 const content_settings::ResourceIdentifier& identifier, 105 const content_settings::ResourceIdentifier& identifier,
106 ContentSetting setting, 106 ContentSetting setting,
107 ExtensionPrefsScope scope) { 107 ExtensionPrefsScope scope) {
108 { 108 {
109 base::AutoLock lock(lock_); 109 base::AutoLock lock(lock_);
110 OriginIdentifierValueMap* map = GetValueMap(ext_id, scope); 110 OriginIdentifierValueMap* map = GetValueMap(ext_id, scope);
111 if (setting == CONTENT_SETTING_DEFAULT) { 111 if (setting == CONTENT_SETTING_DEFAULT) {
112 map->DeleteValue(primary_pattern, secondary_pattern, type, identifier); 112 map->DeleteValue(primary_pattern, secondary_pattern, type, identifier);
113 } else { 113 } else {
114 map->SetValue(primary_pattern, secondary_pattern, type, identifier, 114 map->SetValue(primary_pattern, secondary_pattern, type, identifier,
115 new base::FundamentalValue(setting)); 115 new base::Value(setting));
116 } 116 }
117 } 117 }
118 118
119 // Send notification that content settings changed. (Note: This is responsible 119 // Send notification that content settings changed. (Note: This is responsible
120 // 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
121 // be masked by another extension.) 121 // be masked by another extension.)
122 NotifyOfContentSettingChanged(ext_id, 122 NotifyOfContentSettingChanged(ext_id,
123 scope != kExtensionPrefsScopeRegular); 123 scope != kExtensionPrefsScopeRegular);
124 } 124 }
125 125
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 ContentSettingsStore::FindEntry(const std::string& ext_id) const { 389 ContentSettingsStore::FindEntry(const std::string& ext_id) const {
390 ExtensionEntryMap::const_iterator i; 390 ExtensionEntryMap::const_iterator i;
391 for (i = entries_.begin(); i != entries_.end(); ++i) { 391 for (i = entries_.begin(); i != entries_.end(); ++i) {
392 if (i->second->id == ext_id) 392 if (i->second->id == ext_id)
393 return i; 393 return i;
394 } 394 }
395 return entries_.end(); 395 return entries_.end();
396 } 396 }
397 397
398 } // namespace extensions 398 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698