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 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // Special rights are granted to 'extensions' and 'applications'. The | 26 // Special rights are granted to 'extensions' and 'applications'. The |
27 // storage subsystems and the browsing data remover query this interface | 27 // storage subsystems and the browsing data remover query this interface |
28 // to determine which origins have these rights. | 28 // to determine which origins have these rights. |
29 class ExtensionSpecialStoragePolicy : public storage::SpecialStoragePolicy { | 29 class ExtensionSpecialStoragePolicy : public storage::SpecialStoragePolicy { |
30 public: | 30 public: |
31 explicit ExtensionSpecialStoragePolicy(CookieSettings* cookie_settings); | 31 explicit ExtensionSpecialStoragePolicy(CookieSettings* cookie_settings); |
32 | 32 |
33 // storage::SpecialStoragePolicy methods used by storage subsystems and the | 33 // storage::SpecialStoragePolicy methods used by storage subsystems and the |
34 // browsing data remover. These methods are safe to call on any thread. | 34 // browsing data remover. These methods are safe to call on any thread. |
35 virtual bool IsStorageProtected(const GURL& origin) OVERRIDE; | 35 virtual bool IsStorageProtected(const GURL& origin) override; |
36 virtual bool IsStorageUnlimited(const GURL& origin) OVERRIDE; | 36 virtual bool IsStorageUnlimited(const GURL& origin) override; |
37 virtual bool IsStorageSessionOnly(const GURL& origin) OVERRIDE; | 37 virtual bool IsStorageSessionOnly(const GURL& origin) override; |
38 virtual bool CanQueryDiskSize(const GURL& origin) OVERRIDE; | 38 virtual bool CanQueryDiskSize(const GURL& origin) override; |
39 virtual bool IsFileHandler(const std::string& extension_id) OVERRIDE; | 39 virtual bool IsFileHandler(const std::string& extension_id) override; |
40 virtual bool HasIsolatedStorage(const GURL& origin) OVERRIDE; | 40 virtual bool HasIsolatedStorage(const GURL& origin) override; |
41 virtual bool HasSessionOnlyOrigins() OVERRIDE; | 41 virtual bool HasSessionOnlyOrigins() override; |
42 | 42 |
43 // Methods used by the ExtensionService to populate this class. | 43 // Methods used by the ExtensionService to populate this class. |
44 void GrantRightsForExtension(const extensions::Extension* extension, | 44 void GrantRightsForExtension(const extensions::Extension* extension, |
45 content::BrowserContext* browser_context); | 45 content::BrowserContext* browser_context); |
46 void RevokeRightsForExtension(const extensions::Extension* extension); | 46 void RevokeRightsForExtension(const extensions::Extension* extension); |
47 void RevokeRightsForAllExtensions(); | 47 void RevokeRightsForAllExtensions(); |
48 | 48 |
49 // Decides whether the storage for |extension|'s web extent needs protection. | 49 // Decides whether the storage for |extension|'s web extent needs protection. |
50 bool NeedsProtection(const extensions::Extension* extension); | 50 bool NeedsProtection(const extensions::Extension* extension); |
51 | 51 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 base::Lock lock_; // Synchronize all access to the collections. | 86 base::Lock lock_; // Synchronize all access to the collections. |
87 SpecialCollection protected_apps_; | 87 SpecialCollection protected_apps_; |
88 SpecialCollection installed_apps_; | 88 SpecialCollection installed_apps_; |
89 SpecialCollection unlimited_extensions_; | 89 SpecialCollection unlimited_extensions_; |
90 SpecialCollection file_handler_extensions_; | 90 SpecialCollection file_handler_extensions_; |
91 SpecialCollection isolated_extensions_; | 91 SpecialCollection isolated_extensions_; |
92 scoped_refptr<CookieSettings> cookie_settings_; | 92 scoped_refptr<CookieSettings> cookie_settings_; |
93 }; | 93 }; |
94 | 94 |
95 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ | 95 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
OLD | NEW |