| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/content_settings/tab_specific_content_settings.h" | 5 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 return content_accessed_[content_type]; | 193 return content_accessed_[content_type]; |
| 194 } | 194 } |
| 195 | 195 |
| 196 const std::set<std::string>& | 196 const std::set<std::string>& |
| 197 TabSpecificContentSettings::BlockedResourcesForType( | 197 TabSpecificContentSettings::BlockedResourcesForType( |
| 198 ContentSettingsType content_type) const { | 198 ContentSettingsType content_type) const { |
| 199 if (blocked_resources_[content_type].get()) { | 199 if (blocked_resources_[content_type].get()) { |
| 200 return *blocked_resources_[content_type]; | 200 return *blocked_resources_[content_type]; |
| 201 } else { | 201 } else { |
| 202 CR_DEFINE_STATIC_LOCAL(std::set<std::string>, empty_set, ()); | 202 static std::set<std::string> empty_set; |
| 203 return empty_set; | 203 return empty_set; |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 | 206 |
| 207 void TabSpecificContentSettings::AddBlockedResource( | 207 void TabSpecificContentSettings::AddBlockedResource( |
| 208 ContentSettingsType content_type, | 208 ContentSettingsType content_type, |
| 209 const std::string& resource_identifier) { | 209 const std::string& resource_identifier) { |
| 210 if (!blocked_resources_[content_type].get()) | 210 if (!blocked_resources_[content_type].get()) |
| 211 blocked_resources_[content_type].reset(new std::set<std::string>()); | 211 blocked_resources_[content_type].reset(new std::set<std::string>()); |
| 212 blocked_resources_[content_type]->insert(resource_identifier); | 212 blocked_resources_[content_type]->insert(resource_identifier); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 return new CookiesTreeModel(cookies_->Clone(), | 526 return new CookiesTreeModel(cookies_->Clone(), |
| 527 databases_->Clone(), | 527 databases_->Clone(), |
| 528 local_storages_->Clone(), | 528 local_storages_->Clone(), |
| 529 session_storages_->Clone(), | 529 session_storages_->Clone(), |
| 530 appcaches_->Clone(), | 530 appcaches_->Clone(), |
| 531 indexed_dbs_->Clone(), | 531 indexed_dbs_->Clone(), |
| 532 file_systems_->Clone(), | 532 file_systems_->Clone(), |
| 533 NULL, | 533 NULL, |
| 534 true); | 534 true); |
| 535 } | 535 } |
| OLD | NEW |