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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
565 } | 565 } |
566 bool has_background_page() const { | 566 bool has_background_page() const { |
567 return background_url_.is_valid() || !background_scripts_.empty(); | 567 return background_url_.is_valid() || !background_scripts_.empty(); |
568 } | 568 } |
569 bool allow_background_js_access() const { | 569 bool allow_background_js_access() const { |
570 return allow_background_js_access_; | 570 return allow_background_js_access_; |
571 } | 571 } |
572 const std::vector<std::string>& background_scripts() const { | 572 const std::vector<std::string>& background_scripts() const { |
573 return background_scripts_; | 573 return background_scripts_; |
574 } | 574 } |
575 bool background_page_persists() const { return background_page_persists_; } | 575 bool background_page_is_transient() const { |
576 return background_page_is_transient_; | |
577 } | |
576 bool has_persistent_background_page() const { | 578 bool has_persistent_background_page() const { |
577 return has_background_page() && background_page_persists(); | 579 return has_background_page() && !background_page_is_transient(); |
578 } | 580 } |
579 bool has_lazy_background_page() const { | 581 bool has_lazy_background_page() const { |
Yoyo Zhou
2012/03/28 21:46:51
Why not has_transient_background_page?
Matt Perry
2012/03/28 21:53:14
Yeah... a lot of code calls them "lazy background
| |
580 return has_background_page() && !background_page_persists(); | 582 return has_background_page() && background_page_is_transient(); |
581 } | 583 } |
582 const GURL& options_url() const { return options_url_; } | 584 const GURL& options_url() const { return options_url_; } |
583 const GURL& devtools_url() const { return devtools_url_; } | 585 const GURL& devtools_url() const { return devtools_url_; } |
584 const ExtensionPermissionSet* optional_permission_set() const { | 586 const ExtensionPermissionSet* optional_permission_set() const { |
585 return optional_permission_set_.get(); | 587 return optional_permission_set_.get(); |
586 } | 588 } |
587 const ExtensionPermissionSet* required_permission_set() const { | 589 const ExtensionPermissionSet* required_permission_set() const { |
588 return required_permission_set_.get(); | 590 return required_permission_set_.get(); |
589 } | 591 } |
590 const GURL& update_url() const { return update_url_; } | 592 const GURL& update_url() const { return update_url_; } |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
920 base::hash_set<std::string> web_accessible_resources_; | 922 base::hash_set<std::string> web_accessible_resources_; |
921 | 923 |
922 // Optional URL to a master page of which a single instance should be always | 924 // Optional URL to a master page of which a single instance should be always |
923 // loaded in the background. | 925 // loaded in the background. |
924 GURL background_url_; | 926 GURL background_url_; |
925 | 927 |
926 // Optional list of scripts to use to generate a background page. If this is | 928 // Optional list of scripts to use to generate a background page. If this is |
927 // present, background_url_ will be empty and generated by GetBackgroundURL(). | 929 // present, background_url_ will be empty and generated by GetBackgroundURL(). |
928 std::vector<std::string> background_scripts_; | 930 std::vector<std::string> background_scripts_; |
929 | 931 |
930 // True if the background page should stay loaded forever; false if it should | 932 // False if the background page should stay loaded forever; true if it should |
931 // load on-demand (when it needs to handle an event). Defaults to true. | 933 // load on-demand (when it needs to handle an event). Defaults to false. |
932 bool background_page_persists_; | 934 bool background_page_is_transient_; |
933 | 935 |
934 // True if the background page can be scripted by pages of the app or | 936 // True if the background page can be scripted by pages of the app or |
935 // extension, in which case all such pages must run in the same process. | 937 // extension, in which case all such pages must run in the same process. |
936 // False if such pages are not permitted to script the background page, | 938 // False if such pages are not permitted to script the background page, |
937 // allowing them to run in different processes. | 939 // allowing them to run in different processes. |
938 bool allow_background_js_access_; | 940 bool allow_background_js_access_; |
939 | 941 |
940 // Optional URL to a page for setting options/preferences. | 942 // Optional URL to a page for setting options/preferences. |
941 GURL options_url_; | 943 GURL options_url_; |
942 | 944 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1091 // only contain the removed permissions. | 1093 // only contain the removed permissions. |
1092 const ExtensionPermissionSet* permissions; | 1094 const ExtensionPermissionSet* permissions; |
1093 | 1095 |
1094 UpdatedExtensionPermissionsInfo( | 1096 UpdatedExtensionPermissionsInfo( |
1095 const Extension* extension, | 1097 const Extension* extension, |
1096 const ExtensionPermissionSet* permissions, | 1098 const ExtensionPermissionSet* permissions, |
1097 Reason reason); | 1099 Reason reason); |
1098 }; | 1100 }; |
1099 | 1101 |
1100 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1102 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |