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_COMMON_EXTENSIONS_EXTENSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 return GetResourceURL(url(), relative_path); | 349 return GetResourceURL(url(), relative_path); |
350 } | 350 } |
351 | 351 |
352 // Returns true if the resource matches a pattern in the pattern_set. | 352 // Returns true if the resource matches a pattern in the pattern_set. |
353 bool ResourceMatches(const URLPatternSet& pattern_set, | 353 bool ResourceMatches(const URLPatternSet& pattern_set, |
354 const std::string& resource) const; | 354 const std::string& resource) const; |
355 | 355 |
356 // Returns true if the specified resource is web accessible. | 356 // Returns true if the specified resource is web accessible. |
357 bool IsResourceWebAccessible(const std::string& relative_path) const; | 357 bool IsResourceWebAccessible(const std::string& relative_path) const; |
358 | 358 |
359 // Returns true if the specified resource is a NaCl manifest. | |
360 bool IsResourceNaClManifest(const std::string& resource) const; | |
361 | |
362 // Returns true if the specified page is sandboxed (served in a unique | 359 // Returns true if the specified page is sandboxed (served in a unique |
363 // origin). | 360 // origin). |
364 bool IsSandboxedPage(const std::string& relative_path) const; | 361 bool IsSandboxedPage(const std::string& relative_path) const; |
365 | 362 |
366 // Returns the Content Security Policy that the specified resource should be | 363 // Returns the Content Security Policy that the specified resource should be |
367 // served with. | 364 // served with. |
368 std::string GetResourceContentSecurityPolicy(const std::string& relative_path) | 365 std::string GetResourceContentSecurityPolicy(const std::string& relative_path) |
369 const; | 366 const; |
370 | 367 |
371 // Returns true when 'web_accessible_resources' are defined for the extension. | 368 // Returns true when 'web_accessible_resources' are defined for the extension. |
372 bool HasWebAccessibleResources() const; | 369 bool HasWebAccessibleResources() const; |
373 | 370 |
374 // Returns true when 'nacl_modules' are defined for the extension. | |
375 bool HasNaClModules() const; | |
376 | |
377 // Returns an extension resource object. |relative_path| should be UTF8 | 371 // Returns an extension resource object. |relative_path| should be UTF8 |
378 // encoded. | 372 // encoded. |
379 ExtensionResource GetResource(const std::string& relative_path) const; | 373 ExtensionResource GetResource(const std::string& relative_path) const; |
380 | 374 |
381 // As above, but with |relative_path| following the file system's encoding. | 375 // As above, but with |relative_path| following the file system's encoding. |
382 ExtensionResource GetResource(const FilePath& relative_path) const; | 376 ExtensionResource GetResource(const FilePath& relative_path) const; |
383 | 377 |
384 // |input| is expected to be the text of an rsa public or private key. It | 378 // |input| is expected to be the text of an rsa public or private key. It |
385 // tolerates the presence or absence of bracking header/footer like this: | 379 // tolerates the presence or absence of bracking header/footer like this: |
386 // -----(BEGIN|END) [RSA PUBLIC/PRIVATE] KEY----- | 380 // -----(BEGIN|END) [RSA PUBLIC/PRIVATE] KEY----- |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 | 1185 |
1192 UpdatedExtensionPermissionsInfo( | 1186 UpdatedExtensionPermissionsInfo( |
1193 const Extension* extension, | 1187 const Extension* extension, |
1194 const PermissionSet* permissions, | 1188 const PermissionSet* permissions, |
1195 Reason reason); | 1189 Reason reason); |
1196 }; | 1190 }; |
1197 | 1191 |
1198 } // namespace extensions | 1192 } // namespace extensions |
1199 | 1193 |
1200 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1194 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |