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 |
108 // An NPAPI plugin included in the extension. | 114 // An NPAPI plugin included in the extension. |
109 struct PluginInfo { | 115 struct PluginInfo { |
110 FilePath path; // Path to the plugin. | 116 FilePath path; // Path to the plugin. |
111 bool is_public; // False if only this extension can load this plugin. | 117 bool is_public; // False if only this extension can load this plugin. |
112 }; | 118 }; |
113 | 119 |
114 // An NaCl module included in the extension. | 120 // An NaCl module included in the extension. |
115 struct NaClModuleInfo { | 121 struct NaClModuleInfo { |
116 GURL url; | 122 GURL url; |
117 std::string mime_type; | 123 std::string mime_type; |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 // extension page itself. | 473 // extension page itself. |
468 bool CanCaptureVisiblePage(const GURL& page_url, std::string* error) const; | 474 bool CanCaptureVisiblePage(const GURL& page_url, std::string* error) const; |
469 | 475 |
470 // Returns true if this extension updates itself using the extension | 476 // Returns true if this extension updates itself using the extension |
471 // gallery. | 477 // gallery. |
472 bool UpdatesFromGallery() const; | 478 bool UpdatesFromGallery() const; |
473 | 479 |
474 // Returns true if this extension or app includes areas within |origin|. | 480 // Returns true if this extension or app includes areas within |origin|. |
475 bool OverlapsWithOrigin(const GURL& origin) const; | 481 bool OverlapsWithOrigin(const GURL& origin) const; |
476 | 482 |
| 483 // Returns the sync bucket to use for this extension. |
| 484 SyncType GetSyncType() const; |
| 485 |
477 // Accessors: | 486 // Accessors: |
478 | 487 |
479 const FilePath& path() const { return path_; } | 488 const FilePath& path() const { return path_; } |
480 const GURL& url() const { return extension_url_; } | 489 const GURL& url() const { return extension_url_; } |
481 Location location() const { return location_; } | 490 Location location() const { return location_; } |
482 const std::string& id() const { return id_; } | 491 const std::string& id() const { return id_; } |
483 const Version* version() const { return version_.get(); } | 492 const Version* version() const { return version_.get(); } |
484 const std::string VersionString() const; | 493 const std::string VersionString() const; |
485 const std::string& name() const { return name_; } | 494 const std::string& name() const { return name_; } |
486 const std::string& public_key() const { return public_key_; } | 495 const std::string& public_key() const { return public_key_; } |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 // only contain the removed permissions. | 934 // only contain the removed permissions. |
926 const ExtensionPermissionSet* permissions; | 935 const ExtensionPermissionSet* permissions; |
927 | 936 |
928 UpdatedExtensionPermissionsInfo( | 937 UpdatedExtensionPermissionsInfo( |
929 const Extension* extension, | 938 const Extension* extension, |
930 const ExtensionPermissionSet* permissions, | 939 const ExtensionPermissionSet* permissions, |
931 Reason reason); | 940 Reason reason); |
932 }; | 941 }; |
933 | 942 |
934 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 943 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |