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/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 base::AutoLock locker(lock_); | 41 base::AutoLock locker(lock_); |
42 return unlimited_extensions_.Contains(origin); | 42 return unlimited_extensions_.Contains(origin); |
43 } | 43 } |
44 | 44 |
45 bool ExtensionSpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) { | 45 bool ExtensionSpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) { |
46 if (cookie_settings_ == NULL) | 46 if (cookie_settings_ == NULL) |
47 return false; | 47 return false; |
48 return cookie_settings_->IsCookieSessionOnly(origin); | 48 return cookie_settings_->IsCookieSessionOnly(origin); |
49 } | 49 } |
50 | 50 |
51 bool ExtensionSpecialStoragePolicy::IsInstalledApp(const GURL& origin) { | 51 bool ExtensionSpecialStoragePolicy::CanQueryDiskSize(const GURL& origin) { |
52 return installed_apps_.Contains(origin); | 52 return installed_apps_.Contains(origin); |
53 } | 53 } |
54 | 54 |
55 bool ExtensionSpecialStoragePolicy::HasSessionOnlyOrigins() { | 55 bool ExtensionSpecialStoragePolicy::HasSessionOnlyOrigins() { |
56 if (cookie_settings_ == NULL) | 56 if (cookie_settings_ == NULL) |
57 return false; | 57 return false; |
58 if (cookie_settings_->GetDefaultCookieSetting(NULL) == | 58 if (cookie_settings_->GetDefaultCookieSetting(NULL) == |
59 CONTENT_SETTING_SESSION_ONLY) | 59 CONTENT_SETTING_SESSION_ONLY) |
60 return true; | 60 return true; |
61 ContentSettingsForOneType entries; | 61 ContentSettingsForOneType entries; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { | 203 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { |
204 ClearCache(); | 204 ClearCache(); |
205 extensions_.Clear(); | 205 extensions_.Clear(); |
206 } | 206 } |
207 | 207 |
208 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { | 208 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { |
209 STLDeleteValues(&cached_results_); | 209 STLDeleteValues(&cached_results_); |
210 cached_results_.clear(); | 210 cached_results_.clear(); |
211 } | 211 } |
OLD | NEW |