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 13 matching lines...) Expand all Loading... |
24 // to determine which origins have these rights. | 24 // to determine which origins have these rights. |
25 class ExtensionSpecialStoragePolicy : public quota::SpecialStoragePolicy { | 25 class ExtensionSpecialStoragePolicy : public quota::SpecialStoragePolicy { |
26 public: | 26 public: |
27 explicit ExtensionSpecialStoragePolicy(CookieSettings* cookie_settings); | 27 explicit ExtensionSpecialStoragePolicy(CookieSettings* cookie_settings); |
28 | 28 |
29 // quota::SpecialStoragePolicy methods used by storage subsystems and the | 29 // quota::SpecialStoragePolicy methods used by storage subsystems and the |
30 // browsing data remover. These methods are safe to call on any thread. | 30 // browsing data remover. These methods are safe to call on any thread. |
31 virtual bool IsStorageProtected(const GURL& origin) OVERRIDE; | 31 virtual bool IsStorageProtected(const GURL& origin) OVERRIDE; |
32 virtual bool IsStorageUnlimited(const GURL& origin) OVERRIDE; | 32 virtual bool IsStorageUnlimited(const GURL& origin) OVERRIDE; |
33 virtual bool IsStorageSessionOnly(const GURL& origin) OVERRIDE; | 33 virtual bool IsStorageSessionOnly(const GURL& origin) OVERRIDE; |
| 34 virtual bool IsInstalledApp(const GURL& origin) OVERRIDE; |
34 virtual bool IsFileHandler(const std::string& extension_id) OVERRIDE; | 35 virtual bool IsFileHandler(const std::string& extension_id) OVERRIDE; |
35 virtual bool HasSessionOnlyOrigins() OVERRIDE; | 36 virtual bool HasSessionOnlyOrigins() OVERRIDE; |
36 | 37 |
37 // Methods used by the ExtensionService to populate this class. | 38 // Methods used by the ExtensionService to populate this class. |
38 void GrantRightsForExtension(const extensions::Extension* extension); | 39 void GrantRightsForExtension(const extensions::Extension* extension); |
39 void RevokeRightsForExtension(const extensions::Extension* extension); | 40 void RevokeRightsForExtension(const extensions::Extension* extension); |
40 void RevokeRightsForAllExtensions(); | 41 void RevokeRightsForAllExtensions(); |
41 | 42 |
42 // Decides whether the storage for |extension|'s web extent needs protection. | 43 // Decides whether the storage for |extension|'s web extent needs protection. |
43 bool NeedsProtection(const extensions::Extension* extension); | 44 bool NeedsProtection(const extensions::Extension* extension); |
(...skipping 24 matching lines...) Expand all Loading... |
68 void ClearCache(); | 69 void ClearCache(); |
69 | 70 |
70 ExtensionSet extensions_; | 71 ExtensionSet extensions_; |
71 CachedResults cached_results_; | 72 CachedResults cached_results_; |
72 }; | 73 }; |
73 | 74 |
74 void NotifyChanged(); | 75 void NotifyChanged(); |
75 | 76 |
76 base::Lock lock_; // Synchronize all access to the collections. | 77 base::Lock lock_; // Synchronize all access to the collections. |
77 SpecialCollection protected_apps_; | 78 SpecialCollection protected_apps_; |
| 79 SpecialCollection installed_apps_; |
78 SpecialCollection unlimited_extensions_; | 80 SpecialCollection unlimited_extensions_; |
79 SpecialCollection file_handler_extensions_; | 81 SpecialCollection file_handler_extensions_; |
80 scoped_refptr<CookieSettings> cookie_settings_; | 82 scoped_refptr<CookieSettings> cookie_settings_; |
81 }; | 83 }; |
82 | 84 |
83 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ | 85 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
OLD | NEW |