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/extension_special_storage_policy.h" | 5 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return true; | 122 return true; |
123 ContentSettingsForOneType entries; | 123 ContentSettingsForOneType entries; |
124 cookie_settings_->GetCookieSettings(&entries); | 124 cookie_settings_->GetCookieSettings(&entries); |
125 for (size_t i = 0; i < entries.size(); ++i) { | 125 for (size_t i = 0; i < entries.size(); ++i) { |
126 if (entries[i].setting == CONTENT_SETTING_SESSION_ONLY) | 126 if (entries[i].setting == CONTENT_SETTING_SESSION_ONLY) |
127 return true; | 127 return true; |
128 } | 128 } |
129 return false; | 129 return false; |
130 } | 130 } |
131 | 131 |
132 bool ExtensionSpecialStoragePolicy::IsFileHandler( | |
133 const std::string& extension_id) { | |
134 base::AutoLock locker(lock_); | |
135 return file_handler_extensions_.ContainsExtension(extension_id); | |
136 } | |
137 | |
138 bool ExtensionSpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) { | 132 bool ExtensionSpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) { |
139 base::AutoLock locker(lock_); | 133 base::AutoLock locker(lock_); |
140 return isolated_extensions_.Contains(origin); | 134 return isolated_extensions_.Contains(origin); |
141 } | 135 } |
142 | 136 |
143 bool ExtensionSpecialStoragePolicy::NeedsProtection( | 137 bool ExtensionSpecialStoragePolicy::NeedsProtection( |
144 const extensions::Extension* extension) { | 138 const extensions::Extension* extension) { |
145 return extension->is_hosted_app() && !extension->from_bookmark(); | 139 return extension->is_hosted_app() && !extension->from_bookmark(); |
146 } | 140 } |
147 | 141 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 } | 349 } |
356 | 350 |
357 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { | 351 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { |
358 ClearCache(); | 352 ClearCache(); |
359 extensions_.Clear(); | 353 extensions_.Clear(); |
360 } | 354 } |
361 | 355 |
362 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { | 356 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { |
363 STLDeleteValues(&cached_results_); | 357 STLDeleteValues(&cached_results_); |
364 } | 358 } |
OLD | NEW |