| 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 <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 OriginIdentifierValueMap incognito_persistent_settings; | 45 OriginIdentifierValueMap incognito_persistent_settings; |
| 46 // Session-only incognito content settings. | 46 // Session-only incognito content settings. |
| 47 OriginIdentifierValueMap incognito_session_only_settings; | 47 OriginIdentifierValueMap incognito_session_only_settings; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 ContentSettingsStore::ContentSettingsStore() { | 50 ContentSettingsStore::ContentSettingsStore() { |
| 51 DCHECK(OnCorrectThread()); | 51 DCHECK(OnCorrectThread()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 ContentSettingsStore::~ContentSettingsStore() { | 54 ContentSettingsStore::~ContentSettingsStore() { |
| 55 STLDeleteValues(&entries_); | 55 base::STLDeleteValues(&entries_); |
| 56 } | 56 } |
| 57 | 57 |
| 58 std::unique_ptr<RuleIterator> ContentSettingsStore::GetRuleIterator( | 58 std::unique_ptr<RuleIterator> ContentSettingsStore::GetRuleIterator( |
| 59 ContentSettingsType type, | 59 ContentSettingsType type, |
| 60 const content_settings::ResourceIdentifier& identifier, | 60 const content_settings::ResourceIdentifier& identifier, |
| 61 bool incognito) const { | 61 bool incognito) const { |
| 62 std::vector<std::unique_ptr<RuleIterator>> iterators; | 62 std::vector<std::unique_ptr<RuleIterator>> iterators; |
| 63 // Iterate the extensions based on install time (last installed extensions | 63 // Iterate the extensions based on install time (last installed extensions |
| 64 // first). | 64 // first). |
| 65 ExtensionEntryMap::const_reverse_iterator entry; | 65 ExtensionEntryMap::const_reverse_iterator entry; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 ContentSettingsStore::FindEntry(const std::string& ext_id) const { | 372 ContentSettingsStore::FindEntry(const std::string& ext_id) const { |
| 373 ExtensionEntryMap::const_iterator i; | 373 ExtensionEntryMap::const_iterator i; |
| 374 for (i = entries_.begin(); i != entries_.end(); ++i) { | 374 for (i = entries_.begin(); i != entries_.end(); ++i) { |
| 375 if (i->second->id == ext_id) | 375 if (i->second->id == ext_id) |
| 376 return i; | 376 return i; |
| 377 } | 377 } |
| 378 return entries_.end(); | 378 return entries_.end(); |
| 379 } | 379 } |
| 380 | 380 |
| 381 } // namespace extensions | 381 } // namespace extensions |
| OLD | NEW |