| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions. | 98 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions. |
| 99 enum Type { | 99 enum Type { |
| 100 TYPE_UNKNOWN = 0, | 100 TYPE_UNKNOWN = 0, |
| 101 TYPE_EXTENSION, | 101 TYPE_EXTENSION, |
| 102 TYPE_THEME, | 102 TYPE_THEME, |
| 103 TYPE_USER_SCRIPT, | 103 TYPE_USER_SCRIPT, |
| 104 TYPE_HOSTED_APP, | 104 TYPE_HOSTED_APP, |
| 105 TYPE_PACKAGED_APP | 105 TYPE_PACKAGED_APP |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 enum SyncType { | |
| 109 SYNC_TYPE_NONE = 0, | |
| 110 SYNC_TYPE_EXTENSION, | |
| 111 SYNC_TYPE_APP | |
| 112 }; | |
| 113 | |
| 114 // An NPAPI plugin included in the extension. | 108 // An NPAPI plugin included in the extension. |
| 115 struct PluginInfo { | 109 struct PluginInfo { |
| 116 FilePath path; // Path to the plugin. | 110 FilePath path; // Path to the plugin. |
| 117 bool is_public; // False if only this extension can load this plugin. | 111 bool is_public; // False if only this extension can load this plugin. |
| 118 }; | 112 }; |
| 119 | 113 |
| 120 // An NaCl module included in the extension. | 114 // An NaCl module included in the extension. |
| 121 struct NaClModuleInfo { | 115 struct NaClModuleInfo { |
| 122 GURL url; | 116 GURL url; |
| 123 std::string mime_type; | 117 std::string mime_type; |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 // extension page itself. | 467 // extension page itself. |
| 474 bool CanCaptureVisiblePage(const GURL& page_url, std::string* error) const; | 468 bool CanCaptureVisiblePage(const GURL& page_url, std::string* error) const; |
| 475 | 469 |
| 476 // Returns true if this extension updates itself using the extension | 470 // Returns true if this extension updates itself using the extension |
| 477 // gallery. | 471 // gallery. |
| 478 bool UpdatesFromGallery() const; | 472 bool UpdatesFromGallery() const; |
| 479 | 473 |
| 480 // Returns true if this extension or app includes areas within |origin|. | 474 // Returns true if this extension or app includes areas within |origin|. |
| 481 bool OverlapsWithOrigin(const GURL& origin) const; | 475 bool OverlapsWithOrigin(const GURL& origin) const; |
| 482 | 476 |
| 483 // Returns the sync bucket to use for this extension. | |
| 484 SyncType GetSyncType() const; | |
| 485 | |
| 486 // Accessors: | 477 // Accessors: |
| 487 | 478 |
| 488 const FilePath& path() const { return path_; } | 479 const FilePath& path() const { return path_; } |
| 489 const GURL& url() const { return extension_url_; } | 480 const GURL& url() const { return extension_url_; } |
| 490 Location location() const { return location_; } | 481 Location location() const { return location_; } |
| 491 const std::string& id() const { return id_; } | 482 const std::string& id() const { return id_; } |
| 492 const Version* version() const { return version_.get(); } | 483 const Version* version() const { return version_.get(); } |
| 493 const std::string VersionString() const; | 484 const std::string VersionString() const; |
| 494 const std::string& name() const { return name_; } | 485 const std::string& name() const { return name_; } |
| 495 const std::string& public_key() const { return public_key_; } | 486 const std::string& public_key() const { return public_key_; } |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 // only contain the removed permissions. | 925 // only contain the removed permissions. |
| 935 const ExtensionPermissionSet* permissions; | 926 const ExtensionPermissionSet* permissions; |
| 936 | 927 |
| 937 UpdatedExtensionPermissionsInfo( | 928 UpdatedExtensionPermissionsInfo( |
| 938 const Extension* extension, | 929 const Extension* extension, |
| 939 const ExtensionPermissionSet* permissions, | 930 const ExtensionPermissionSet* permissions, |
| 940 Reason reason); | 931 Reason reason); |
| 941 }; | 932 }; |
| 942 | 933 |
| 943 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 934 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |