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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 287 } |
288 } | 288 } |
289 return settings; | 289 return settings; |
290 } | 290 } |
291 | 291 |
292 void ContentSettingsStore::SetExtensionContentSettingFromList( | 292 void ContentSettingsStore::SetExtensionContentSettingFromList( |
293 const std::string& extension_id, | 293 const std::string& extension_id, |
294 const base::ListValue* list, | 294 const base::ListValue* list, |
295 ExtensionPrefsScope scope) { | 295 ExtensionPrefsScope scope) { |
296 for (const auto& value : *list) { | 296 for (const auto& value : *list) { |
297 base::DictionaryValue* dict; | 297 const base::DictionaryValue* dict; |
298 if (!value->GetAsDictionary(&dict)) { | 298 if (!value.GetAsDictionary(&dict)) { |
299 NOTREACHED(); | 299 NOTREACHED(); |
300 continue; | 300 continue; |
301 } | 301 } |
302 std::string primary_pattern_str; | 302 std::string primary_pattern_str; |
303 dict->GetString(keys::kPrimaryPatternKey, &primary_pattern_str); | 303 dict->GetString(keys::kPrimaryPatternKey, &primary_pattern_str); |
304 ContentSettingsPattern primary_pattern = | 304 ContentSettingsPattern primary_pattern = |
305 ContentSettingsPattern::FromString(primary_pattern_str); | 305 ContentSettingsPattern::FromString(primary_pattern_str); |
306 DCHECK(primary_pattern.IsValid()); | 306 DCHECK(primary_pattern.IsValid()); |
307 | 307 |
308 std::string secondary_pattern_str; | 308 std::string secondary_pattern_str; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 ContentSettingsStore::ExtensionEntries::iterator | 384 ContentSettingsStore::ExtensionEntries::iterator |
385 ContentSettingsStore::FindIterator(const std::string& ext_id) { | 385 ContentSettingsStore::FindIterator(const std::string& ext_id) { |
386 return std::find_if(entries_.begin(), entries_.end(), | 386 return std::find_if(entries_.begin(), entries_.end(), |
387 [ext_id](const std::unique_ptr<ExtensionEntry>& entry) { | 387 [ext_id](const std::unique_ptr<ExtensionEntry>& entry) { |
388 return entry->id == ext_id; | 388 return entry->id == ext_id; |
389 }); | 389 }); |
390 } | 390 } |
391 | 391 |
392 } // namespace extensions | 392 } // namespace extensions |
OLD | NEW |