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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } | 553 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } |
554 | 554 |
555 const std::string& content_security_policy() const { | 555 const std::string& content_security_policy() const { |
556 return content_security_policy_; | 556 return content_security_policy_; |
557 } | 557 } |
558 | 558 |
559 // App-related. | 559 // App-related. |
560 bool is_app() const { return is_app_; } | 560 bool is_app() const { return is_app_; } |
561 bool is_platform_app() const { return is_platform_app_; } | 561 bool is_platform_app() const { return is_platform_app_; } |
562 bool is_hosted_app() const { return is_app() && !web_extent().is_empty(); } | 562 bool is_hosted_app() const { return is_app() && !web_extent().is_empty(); } |
563 bool is_packaged_app() const { return is_app() && web_extent().is_empty(); } | 563 bool is_packaged_app() const { |
| 564 return !is_platform_app() && is_app() && web_extent().is_empty(); |
| 565 } |
564 bool is_storage_isolated() const { return is_app() && is_storage_isolated_; } | 566 bool is_storage_isolated() const { return is_app() && is_storage_isolated_; } |
565 const URLPatternSet& web_extent() const { return extent_; } | 567 const URLPatternSet& web_extent() const { return extent_; } |
566 const std::string& launch_local_path() const { return launch_local_path_; } | 568 const std::string& launch_local_path() const { return launch_local_path_; } |
567 const std::string& launch_web_url() const { return launch_web_url_; } | 569 const std::string& launch_web_url() const { return launch_web_url_; } |
568 extension_misc::LaunchContainer launch_container() const { | 570 extension_misc::LaunchContainer launch_container() const { |
569 return launch_container_; | 571 return launch_container_; |
570 } | 572 } |
571 int launch_width() const { return launch_width_; } | 573 int launch_width() const { return launch_width_; } |
572 int launch_height() const { return launch_height_; } | 574 int launch_height() const { return launch_height_; } |
573 | 575 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 | 689 |
688 // Updates the launch URL and extents for the extension using the given | 690 // Updates the launch URL and extents for the extension using the given |
689 // |override_url|. | 691 // |override_url|. |
690 void OverrideLaunchUrl(const GURL& override_url); | 692 void OverrideLaunchUrl(const GURL& override_url); |
691 | 693 |
692 // Returns true if this extension can specify |api|. | 694 // Returns true if this extension can specify |api|. |
693 bool CanSpecifyAPIPermission(const ExtensionAPIPermission* api, | 695 bool CanSpecifyAPIPermission(const ExtensionAPIPermission* api, |
694 std::string* error) const; | 696 std::string* error) const; |
695 bool CanSpecifyComponentOnlyPermission() const; | 697 bool CanSpecifyComponentOnlyPermission() const; |
696 bool CanSpecifyExperimentalPermission() const; | 698 bool CanSpecifyExperimentalPermission() const; |
697 bool CanSpecifyPermissionForHostedApp( | |
698 const ExtensionAPIPermission* api) const; | |
699 | 699 |
700 // Checks whether the host |pattern| is allowed for this extension, given API | 700 // Checks whether the host |pattern| is allowed for this extension, given API |
701 // permissions |permissions|. | 701 // permissions |permissions|. |
702 bool CanSpecifyHostPermission(const URLPattern& pattern, | 702 bool CanSpecifyHostPermission(const URLPattern& pattern, |
703 const ExtensionAPIPermissionSet& permissions) const; | 703 const ExtensionAPIPermissionSet& permissions) const; |
704 | 704 |
705 // Cached images for this extension. This should only be touched on the UI | 705 // Cached images for this extension. This should only be touched on the UI |
706 // thread. | 706 // thread. |
707 mutable ImageCache image_cache_; | 707 mutable ImageCache image_cache_; |
708 | 708 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 // only contain the removed permissions. | 946 // only contain the removed permissions. |
947 const ExtensionPermissionSet* permissions; | 947 const ExtensionPermissionSet* permissions; |
948 | 948 |
949 UpdatedExtensionPermissionsInfo( | 949 UpdatedExtensionPermissionsInfo( |
950 const Extension* extension, | 950 const Extension* extension, |
951 const ExtensionPermissionSet* permissions, | 951 const ExtensionPermissionSet* permissions, |
952 Reason reason); | 952 Reason reason); |
953 }; | 953 }; |
954 | 954 |
955 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 955 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |