Index: chrome/browser/extensions/extension_special_storage_policy.cc |
diff --git a/chrome/browser/extensions/extension_special_storage_policy.cc b/chrome/browser/extensions/extension_special_storage_policy.cc |
index 08ff3f2ee9267bc90ac0ac7b7800f40bc4700622..95a2486599bab8b3a7e9c703fc0a8116cbbbc9f7 100644 |
--- a/chrome/browser/extensions/extension_special_storage_policy.cc |
+++ b/chrome/browser/extensions/extension_special_storage_policy.cc |
@@ -5,11 +5,15 @@ |
#include "chrome/browser/extensions/extension_special_storage_policy.h" |
#include "base/logging.h" |
+#include "chrome/browser/content_settings/host_content_settings_map.h" |
+#include "chrome/common/content_settings.h" |
#include "chrome/common/extensions/extension.h" |
#include "chrome/common/url_constants.h" |
#include "content/browser/browser_thread.h" |
-ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy() {} |
+ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy( |
+ HostContentSettingsMap* host_content_settings_map) |
+ : host_content_settings_map_(host_content_settings_map) {} |
ExtensionSpecialStoragePolicy::~ExtensionSpecialStoragePolicy() {} |
@@ -25,6 +29,14 @@ bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) { |
return unlimited_extensions_.Contains(origin); |
} |
+bool ExtensionSpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) { |
+ if (host_content_settings_map_ == NULL) |
+ return false; |
+ ContentSetting content_setting = host_content_settings_map_-> |
+ GetCookieContentSetting(origin, origin, true); |
+ return (content_setting == CONTENT_SETTING_SESSION_ONLY); |
+} |
+ |
bool ExtensionSpecialStoragePolicy::IsFileHandler( |
const std::string& extension_id) { |
base::AutoLock locker(lock_); |