OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 return chrome_url_overrides_; | 433 return chrome_url_overrides_; |
434 } | 434 } |
435 const std::string omnibox_keyword() const { return omnibox_keyword_; } | 435 const std::string omnibox_keyword() const { return omnibox_keyword_; } |
436 bool incognito_split_mode() const { return incognito_split_mode_; } | 436 bool incognito_split_mode() const { return incognito_split_mode_; } |
437 const std::vector<TtsVoice>& tts_voices() const { return tts_voices_; } | 437 const std::vector<TtsVoice>& tts_voices() const { return tts_voices_; } |
438 | 438 |
439 // App-related. | 439 // App-related. |
440 bool is_app() const { return is_app_; } | 440 bool is_app() const { return is_app_; } |
441 bool is_hosted_app() const { return is_app() && !web_extent().is_empty(); } | 441 bool is_hosted_app() const { return is_app() && !web_extent().is_empty(); } |
442 bool is_packaged_app() const { return is_app() && web_extent().is_empty(); } | 442 bool is_packaged_app() const { return is_app() && web_extent().is_empty(); } |
| 443 bool is_storage_isolated() const { return is_app() && is_storage_isolated_; } |
443 const ExtensionExtent& web_extent() const { return extent_; } | 444 const ExtensionExtent& web_extent() const { return extent_; } |
444 const std::string& launch_local_path() const { return launch_local_path_; } | 445 const std::string& launch_local_path() const { return launch_local_path_; } |
445 const std::string& launch_web_url() const { return launch_web_url_; } | 446 const std::string& launch_web_url() const { return launch_web_url_; } |
446 extension_misc::LaunchContainer launch_container() const { | 447 extension_misc::LaunchContainer launch_container() const { |
447 return launch_container_; | 448 return launch_container_; |
448 } | 449 } |
449 int launch_width() const { return launch_width_; } | 450 int launch_width() const { return launch_width_; } |
450 int launch_height() const { return launch_height_; } | 451 int launch_height() const { return launch_height_; } |
451 | 452 |
452 // Theme-related. | 453 // Theme-related. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 void(UserScript::*add_method)(const std::string& glob), | 520 void(UserScript::*add_method)(const std::string& glob), |
520 UserScript *instance); | 521 UserScript *instance); |
521 | 522 |
522 // Helpers to load various chunks of the manifest. | 523 // Helpers to load various chunks of the manifest. |
523 bool LoadIsApp(const DictionaryValue* manifest, std::string* error); | 524 bool LoadIsApp(const DictionaryValue* manifest, std::string* error); |
524 bool LoadExtent(const DictionaryValue* manifest, const char* key, | 525 bool LoadExtent(const DictionaryValue* manifest, const char* key, |
525 ExtensionExtent* extent, const char* list_error, | 526 ExtensionExtent* extent, const char* list_error, |
526 const char* value_error, std::string* error); | 527 const char* value_error, std::string* error); |
527 bool LoadLaunchContainer(const DictionaryValue* manifest, std::string* error); | 528 bool LoadLaunchContainer(const DictionaryValue* manifest, std::string* error); |
528 bool LoadLaunchURL(const DictionaryValue* manifest, std::string* error); | 529 bool LoadLaunchURL(const DictionaryValue* manifest, std::string* error); |
| 530 bool LoadAppIsolation(const DictionaryValue* manifest, std::string* error); |
529 bool EnsureNotHybridApp(const DictionaryValue* manifest, std::string* error); | 531 bool EnsureNotHybridApp(const DictionaryValue* manifest, std::string* error); |
530 | 532 |
531 // Helper method to load an ExtensionAction from the page_action or | 533 // Helper method to load an ExtensionAction from the page_action or |
532 // browser_action entries in the manifest. | 534 // browser_action entries in the manifest. |
533 ExtensionAction* LoadExtensionActionHelper( | 535 ExtensionAction* LoadExtensionActionHelper( |
534 const DictionaryValue* extension_action, std::string* error); | 536 const DictionaryValue* extension_action, std::string* error); |
535 | 537 |
536 // Calculates the effective host permissions from the permissions and content | 538 // Calculates the effective host permissions from the permissions and content |
537 // script petterns. | 539 // script petterns. |
538 void InitEffectiveHostPermissions(); | 540 void InitEffectiveHostPermissions(); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 // A copy of the manifest that this extension was created from. | 675 // A copy of the manifest that this extension was created from. |
674 scoped_ptr<DictionaryValue> manifest_value_; | 676 scoped_ptr<DictionaryValue> manifest_value_; |
675 | 677 |
676 // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs | 678 // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs |
677 // which override the handling of those URLs. (see ExtensionOverrideUI). | 679 // which override the handling of those URLs. (see ExtensionOverrideUI). |
678 URLOverrideMap chrome_url_overrides_; | 680 URLOverrideMap chrome_url_overrides_; |
679 | 681 |
680 // Whether this extension uses app features. | 682 // Whether this extension uses app features. |
681 bool is_app_; | 683 bool is_app_; |
682 | 684 |
| 685 // Whether this extension requests isolated storage. |
| 686 bool is_storage_isolated_; |
| 687 |
683 // The local path inside the extension to use with the launcher. | 688 // The local path inside the extension to use with the launcher. |
684 std::string launch_local_path_; | 689 std::string launch_local_path_; |
685 | 690 |
686 // A web url to use with the launcher. Note that this might be relative or | 691 // A web url to use with the launcher. Note that this might be relative or |
687 // absolute. If relative, it is relative to web_origin. | 692 // absolute. If relative, it is relative to web_origin. |
688 std::string launch_web_url_; | 693 std::string launch_web_url_; |
689 | 694 |
690 // The type of container to launch into. | 695 // The type of container to launch into. |
691 extension_misc::LaunchContainer launch_container_; | 696 extension_misc::LaunchContainer launch_container_; |
692 | 697 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 // Was the extension already disabled? | 761 // Was the extension already disabled? |
757 bool already_disabled; | 762 bool already_disabled; |
758 | 763 |
759 // The extension being unloaded - this should always be non-NULL. | 764 // The extension being unloaded - this should always be non-NULL. |
760 const Extension* extension; | 765 const Extension* extension; |
761 | 766 |
762 UnloadedExtensionInfo(const Extension* extension, Reason reason); | 767 UnloadedExtensionInfo(const Extension* extension, Reason reason); |
763 }; | 768 }; |
764 | 769 |
765 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 770 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |