| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 UPGRADE, | 101 UPGRADE, |
| 102 NEW_INSTALL | 102 NEW_INSTALL |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 enum SyncType { | 105 enum SyncType { |
| 106 SYNC_TYPE_NONE = 0, | 106 SYNC_TYPE_NONE = 0, |
| 107 SYNC_TYPE_EXTENSION, | 107 SYNC_TYPE_EXTENSION, |
| 108 SYNC_TYPE_APP | 108 SYNC_TYPE_APP |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 // An NaCl module included in the extension. | |
| 112 struct NaClModuleInfo { | |
| 113 GURL url; | |
| 114 std::string mime_type; | |
| 115 }; | |
| 116 | |
| 117 // A base class for parsed manifest data that APIs want to store on | 111 // A base class for parsed manifest data that APIs want to store on |
| 118 // the extension. Related to base::SupportsUserData, but with an immutable | 112 // the extension. Related to base::SupportsUserData, but with an immutable |
| 119 // thread-safe interface to match Extension. | 113 // thread-safe interface to match Extension. |
| 120 struct ManifestData { | 114 struct ManifestData { |
| 121 virtual ~ManifestData() {} | 115 virtual ~ManifestData() {} |
| 122 }; | 116 }; |
| 123 | 117 |
| 124 enum InitFromValueFlags { | 118 enum InitFromValueFlags { |
| 125 NO_FLAGS = 0, | 119 NO_FLAGS = 0, |
| 126 | 120 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 const std::string& non_localized_name() const { return non_localized_name_; } | 301 const std::string& non_localized_name() const { return non_localized_name_; } |
| 308 // Base64-encoded version of the key used to sign this extension. | 302 // Base64-encoded version of the key used to sign this extension. |
| 309 // In pseudocode, returns | 303 // In pseudocode, returns |
| 310 // base::Base64Encode(RSAPrivateKey(pem_file).ExportPublicKey()). | 304 // base::Base64Encode(RSAPrivateKey(pem_file).ExportPublicKey()). |
| 311 const std::string& public_key() const { return public_key_; } | 305 const std::string& public_key() const { return public_key_; } |
| 312 const std::string& description() const { return description_; } | 306 const std::string& description() const { return description_; } |
| 313 int manifest_version() const { return manifest_version_; } | 307 int manifest_version() const { return manifest_version_; } |
| 314 bool converted_from_user_script() const { | 308 bool converted_from_user_script() const { |
| 315 return converted_from_user_script_; | 309 return converted_from_user_script_; |
| 316 } | 310 } |
| 317 const std::vector<NaClModuleInfo>& nacl_modules() const { | |
| 318 return nacl_modules_; | |
| 319 } | |
| 320 PermissionsData* permissions_data() { return permissions_data_.get(); } | 311 PermissionsData* permissions_data() { return permissions_data_.get(); } |
| 321 const PermissionsData* permissions_data() const { | 312 const PermissionsData* permissions_data() const { |
| 322 return permissions_data_.get(); | 313 return permissions_data_.get(); |
| 323 } | 314 } |
| 324 | 315 |
| 325 // Appends |new_warning[s]| to install_warnings_. | 316 // Appends |new_warning[s]| to install_warnings_. |
| 326 void AddInstallWarning(const InstallWarning& new_warning); | 317 void AddInstallWarning(const InstallWarning& new_warning); |
| 327 void AddInstallWarnings(const std::vector<InstallWarning>& new_warnings); | 318 void AddInstallWarnings(const std::vector<InstallWarning>& new_warnings); |
| 328 const std::vector<InstallWarning>& install_warnings() const { | 319 const std::vector<InstallWarning>& install_warnings() const { |
| 329 return install_warnings_; | 320 return install_warnings_; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 URLPatternSet* extent, | 393 URLPatternSet* extent, |
| 403 const char* list_error, | 394 const char* list_error, |
| 404 const char* value_error, | 395 const char* value_error, |
| 405 string16* error); | 396 string16* error); |
| 406 bool LoadLaunchContainer(string16* error); | 397 bool LoadLaunchContainer(string16* error); |
| 407 bool LoadLaunchURL(string16* error); | 398 bool LoadLaunchURL(string16* error); |
| 408 | 399 |
| 409 bool LoadSharedFeatures(string16* error); | 400 bool LoadSharedFeatures(string16* error); |
| 410 bool LoadDescription(string16* error); | 401 bool LoadDescription(string16* error); |
| 411 bool LoadManifestVersion(string16* error); | 402 bool LoadManifestVersion(string16* error); |
| 412 bool LoadNaClModules(string16* error); | |
| 413 | 403 |
| 414 // Returns true if the extension has more than one "UI surface". For example, | 404 // Returns true if the extension has more than one "UI surface". For example, |
| 415 // an extension that has a browser action and a page action. | 405 // an extension that has a browser action and a page action. |
| 416 bool HasMultipleUISurfaces() const; | 406 bool HasMultipleUISurfaces() const; |
| 417 | 407 |
| 418 // Updates the launch URL and extents for the extension using the given | 408 // Updates the launch URL and extents for the extension using the given |
| 419 // |override_url|. | 409 // |override_url|. |
| 420 void OverrideLaunchUrl(const GURL& override_url); | 410 void OverrideLaunchUrl(const GURL& override_url); |
| 421 | 411 |
| 422 bool CheckMinimumChromeVersion(string16* error) const; | 412 bool CheckMinimumChromeVersion(string16* error) const; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // The extension's version. | 452 // The extension's version. |
| 463 scoped_ptr<base::Version> version_; | 453 scoped_ptr<base::Version> version_; |
| 464 | 454 |
| 465 // An optional longer description of the extension. | 455 // An optional longer description of the extension. |
| 466 std::string description_; | 456 std::string description_; |
| 467 | 457 |
| 468 // True if the extension was generated from a user script. (We show slightly | 458 // True if the extension was generated from a user script. (We show slightly |
| 469 // different UI if so). | 459 // different UI if so). |
| 470 bool converted_from_user_script_; | 460 bool converted_from_user_script_; |
| 471 | 461 |
| 472 // Optional list of NaCl modules and associated properties. | |
| 473 std::vector<NaClModuleInfo> nacl_modules_; | |
| 474 | |
| 475 // The public key used to sign the contents of the crx package. | 462 // The public key used to sign the contents of the crx package. |
| 476 std::string public_key_; | 463 std::string public_key_; |
| 477 | 464 |
| 478 // The manifest from which this extension was created. | 465 // The manifest from which this extension was created. |
| 479 scoped_ptr<Manifest> manifest_; | 466 scoped_ptr<Manifest> manifest_; |
| 480 | 467 |
| 481 // Stored parsed manifest data. | 468 // Stored parsed manifest data. |
| 482 ManifestDataMap manifest_data_; | 469 ManifestDataMap manifest_data_; |
| 483 | 470 |
| 484 // Set to true at the end of InitValue when initialization is finished. | 471 // Set to true at the end of InitValue when initialization is finished. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 | 576 |
| 590 UpdatedExtensionPermissionsInfo( | 577 UpdatedExtensionPermissionsInfo( |
| 591 const Extension* extension, | 578 const Extension* extension, |
| 592 const PermissionSet* permissions, | 579 const PermissionSet* permissions, |
| 593 Reason reason); | 580 Reason reason); |
| 594 }; | 581 }; |
| 595 | 582 |
| 596 } // namespace extensions | 583 } // namespace extensions |
| 597 | 584 |
| 598 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 585 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |