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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 FROM_BOOKMARK = 1 << 4, | 240 FROM_BOOKMARK = 1 << 4, |
241 | 241 |
242 // |FOLLOW_SYMLINKS_ANYWHERE| means that resources can be symlinks to | 242 // |FOLLOW_SYMLINKS_ANYWHERE| means that resources can be symlinks to |
243 // anywhere in the filesystem, rather than being restricted to the | 243 // anywhere in the filesystem, rather than being restricted to the |
244 // extension directory. | 244 // extension directory. |
245 FOLLOW_SYMLINKS_ANYWHERE = 1 << 5, | 245 FOLLOW_SYMLINKS_ANYWHERE = 1 << 5, |
246 | 246 |
247 // |ERROR_ON_PRIVATE_KEY| means that private keys inside an | 247 // |ERROR_ON_PRIVATE_KEY| means that private keys inside an |
248 // extension should be errors rather than warnings. | 248 // extension should be errors rather than warnings. |
249 ERROR_ON_PRIVATE_KEY = 1 << 6, | 249 ERROR_ON_PRIVATE_KEY = 1 << 6, |
| 250 |
| 251 // |FROM_DEFAULT| indicates the extension was created as default. |
| 252 FROM_DEFAULT = 1 << 7, |
250 }; | 253 }; |
251 | 254 |
252 static scoped_refptr<Extension> Create(const FilePath& path, | 255 static scoped_refptr<Extension> Create(const FilePath& path, |
253 Location location, | 256 Location location, |
254 const base::DictionaryValue& value, | 257 const base::DictionaryValue& value, |
255 int flags, | 258 int flags, |
256 std::string* error); | 259 std::string* error); |
257 | 260 |
258 // In a few special circumstances, we want to create an Extension and give it | 261 // In a few special circumstances, we want to create an Extension and give it |
259 // an explicit id. Most consumers should just use the other Create() method. | 262 // an explicit id. Most consumers should just use the other Create() method. |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 const OAuth2Info& oauth2_info() const { return oauth2_info_; } | 691 const OAuth2Info& oauth2_info() const { return oauth2_info_; } |
689 const std::vector<webkit_glue::WebIntentServiceData>& | 692 const std::vector<webkit_glue::WebIntentServiceData>& |
690 intents_services() const { | 693 intents_services() const { |
691 return intents_services_; | 694 return intents_services_; |
692 } | 695 } |
693 | 696 |
694 bool wants_file_access() const { return wants_file_access_; } | 697 bool wants_file_access() const { return wants_file_access_; } |
695 int creation_flags() const { return creation_flags_; } | 698 int creation_flags() const { return creation_flags_; } |
696 bool from_webstore() const { return (creation_flags_ & FROM_WEBSTORE) != 0; } | 699 bool from_webstore() const { return (creation_flags_ & FROM_WEBSTORE) != 0; } |
697 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } | 700 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } |
| 701 bool from_default() const { return (creation_flags_ & FROM_DEFAULT) != 0; } |
698 | 702 |
699 // App-related. | 703 // App-related. |
700 bool is_app() const { | 704 bool is_app() const { |
701 return is_packaged_app() || is_hosted_app() || is_platform_app(); | 705 return is_packaged_app() || is_hosted_app() || is_platform_app(); |
702 } | 706 } |
703 bool is_platform_app() const; | 707 bool is_platform_app() const; |
704 bool is_hosted_app() const; | 708 bool is_hosted_app() const; |
705 bool is_packaged_app() const; | 709 bool is_packaged_app() const; |
706 bool is_storage_isolated() const { return is_storage_isolated_; } | 710 bool is_storage_isolated() const { return is_storage_isolated_; } |
707 const URLPatternSet& web_extent() const { return extent_; } | 711 const URLPatternSet& web_extent() const { return extent_; } |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 | 1204 |
1201 UpdatedExtensionPermissionsInfo( | 1205 UpdatedExtensionPermissionsInfo( |
1202 const Extension* extension, | 1206 const Extension* extension, |
1203 const PermissionSet* permissions, | 1207 const PermissionSet* permissions, |
1204 Reason reason); | 1208 Reason reason); |
1205 }; | 1209 }; |
1206 | 1210 |
1207 } // namespace extensions | 1211 } // namespace extensions |
1208 | 1212 |
1209 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1213 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |