| 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 12 #include "chrome/browser/profiles/profile.h" | |
| 13 #include "extensions/common/extension_set.h" | 12 #include "extensions/common/extension_set.h" |
| 14 #include "storage/browser/quota/special_storage_policy.h" | 13 #include "storage/browser/quota/special_storage_policy.h" |
| 15 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 16 | 15 |
| 17 namespace content { | 16 namespace content { |
| 18 class BrowserContext; | 17 class BrowserContext; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace content_settings { | 20 namespace content_settings { |
| 22 class CookieSettings; | 21 class CookieSettings; |
| 23 } | 22 } |
| 24 | 23 |
| 25 namespace extensions { | 24 namespace extensions { |
| 26 class Extension; | 25 class Extension; |
| 27 } | 26 } |
| 28 | 27 |
| 29 // Special rights are granted to 'extensions' and 'applications'. The | 28 // Special rights are granted to 'extensions' and 'applications'. The |
| 30 // storage subsystems and the browsing data remover query this interface | 29 // storage subsystems and the browsing data remover query this interface |
| 31 // to determine which origins have these rights. | 30 // to determine which origins have these rights. |
| 32 class ExtensionSpecialStoragePolicy : public storage::SpecialStoragePolicy { | 31 class ExtensionSpecialStoragePolicy : public storage::SpecialStoragePolicy { |
| 33 public: | 32 public: |
| 34 explicit ExtensionSpecialStoragePolicy(Profile* profile); | 33 explicit ExtensionSpecialStoragePolicy( |
| 34 content_settings::CookieSettings* cookie_settings); |
| 35 | 35 |
| 36 // storage::SpecialStoragePolicy methods used by storage subsystems and the | 36 // storage::SpecialStoragePolicy methods used by storage subsystems and the |
| 37 // browsing data remover. These methods are safe to call on any thread. | 37 // browsing data remover. These methods are safe to call on any thread. |
| 38 bool IsStorageProtected(const GURL& origin) override; | 38 bool IsStorageProtected(const GURL& origin) override; |
| 39 bool IsStorageUnlimited(const GURL& origin) override; | 39 bool IsStorageUnlimited(const GURL& origin) override; |
| 40 bool IsStorageSessionOnly(const GURL& origin) override; | 40 bool IsStorageSessionOnly(const GURL& origin) override; |
| 41 bool CanQueryDiskSize(const GURL& origin) override; | 41 bool CanQueryDiskSize(const GURL& origin) override; |
| 42 bool HasIsolatedStorage(const GURL& origin) override; | 42 bool HasIsolatedStorage(const GURL& origin) override; |
| 43 bool HasSessionOnlyOrigins() override; | 43 bool HasSessionOnlyOrigins() override; |
| 44 bool IsStorageDurable(const GURL& origin) override; | 44 bool IsStorageDurable(const GURL& origin) override; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void NotifyRevoked(const GURL& origin, int change_flags); | 87 void NotifyRevoked(const GURL& origin, int change_flags); |
| 88 void NotifyCleared(); | 88 void NotifyCleared(); |
| 89 | 89 |
| 90 base::Lock lock_; // Synchronize all access to the collections. | 90 base::Lock lock_; // Synchronize all access to the collections. |
| 91 SpecialCollection protected_apps_; | 91 SpecialCollection protected_apps_; |
| 92 SpecialCollection installed_apps_; | 92 SpecialCollection installed_apps_; |
| 93 SpecialCollection unlimited_extensions_; | 93 SpecialCollection unlimited_extensions_; |
| 94 SpecialCollection file_handler_extensions_; | 94 SpecialCollection file_handler_extensions_; |
| 95 SpecialCollection isolated_extensions_; | 95 SpecialCollection isolated_extensions_; |
| 96 SpecialCollection content_capabilities_unlimited_extensions_; | 96 SpecialCollection content_capabilities_unlimited_extensions_; |
| 97 | |
| 98 scoped_refptr<content_settings::CookieSettings> cookie_settings_; | 97 scoped_refptr<content_settings::CookieSettings> cookie_settings_; |
| 99 Profile* profile_; | |
| 100 }; | 98 }; |
| 101 | 99 |
| 102 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ | 100 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
| OLD | NEW |