| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 return chrome_url_overrides_; | 451 return chrome_url_overrides_; |
| 452 } | 452 } |
| 453 const std::string omnibox_keyword() const { return omnibox_keyword_; } | 453 const std::string omnibox_keyword() const { return omnibox_keyword_; } |
| 454 bool incognito_split_mode() const { return incognito_split_mode_; } | 454 bool incognito_split_mode() const { return incognito_split_mode_; } |
| 455 const std::vector<TtsVoice>& tts_voices() const { return tts_voices_; } | 455 const std::vector<TtsVoice>& tts_voices() const { return tts_voices_; } |
| 456 | 456 |
| 457 // App-related. | 457 // App-related. |
| 458 bool is_app() const { return is_app_; } | 458 bool is_app() const { return is_app_; } |
| 459 bool is_hosted_app() const { return is_app() && !web_extent().is_empty(); } | 459 bool is_hosted_app() const { return is_app() && !web_extent().is_empty(); } |
| 460 bool is_packaged_app() const { return is_app() && web_extent().is_empty(); } | 460 bool is_packaged_app() const { return is_app() && web_extent().is_empty(); } |
| 461 bool is_storage_isolated() const { return is_app() && is_storage_isolated_; } |
| 461 const ExtensionExtent& web_extent() const { return extent_; } | 462 const ExtensionExtent& web_extent() const { return extent_; } |
| 462 const std::string& launch_local_path() const { return launch_local_path_; } | 463 const std::string& launch_local_path() const { return launch_local_path_; } |
| 463 const std::string& launch_web_url() const { return launch_web_url_; } | 464 const std::string& launch_web_url() const { return launch_web_url_; } |
| 464 extension_misc::LaunchContainer launch_container() const { | 465 extension_misc::LaunchContainer launch_container() const { |
| 465 return launch_container_; | 466 return launch_container_; |
| 466 } | 467 } |
| 467 int launch_width() const { return launch_width_; } | 468 int launch_width() const { return launch_width_; } |
| 468 int launch_height() const { return launch_height_; } | 469 int launch_height() const { return launch_height_; } |
| 469 | 470 |
| 470 // Theme-related. | 471 // Theme-related. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 void(UserScript::*add_method)(const std::string& glob), | 538 void(UserScript::*add_method)(const std::string& glob), |
| 538 UserScript *instance); | 539 UserScript *instance); |
| 539 | 540 |
| 540 // Helpers to load various chunks of the manifest. | 541 // Helpers to load various chunks of the manifest. |
| 541 bool LoadIsApp(const DictionaryValue* manifest, std::string* error); | 542 bool LoadIsApp(const DictionaryValue* manifest, std::string* error); |
| 542 bool LoadExtent(const DictionaryValue* manifest, const char* key, | 543 bool LoadExtent(const DictionaryValue* manifest, const char* key, |
| 543 ExtensionExtent* extent, const char* list_error, | 544 ExtensionExtent* extent, const char* list_error, |
| 544 const char* value_error, std::string* error); | 545 const char* value_error, std::string* error); |
| 545 bool LoadLaunchContainer(const DictionaryValue* manifest, std::string* error); | 546 bool LoadLaunchContainer(const DictionaryValue* manifest, std::string* error); |
| 546 bool LoadLaunchURL(const DictionaryValue* manifest, std::string* error); | 547 bool LoadLaunchURL(const DictionaryValue* manifest, std::string* error); |
| 548 bool LoadAppIsolation(const DictionaryValue* manifest, std::string* error); |
| 547 bool EnsureNotHybridApp(const DictionaryValue* manifest, std::string* error); | 549 bool EnsureNotHybridApp(const DictionaryValue* manifest, std::string* error); |
| 548 | 550 |
| 549 // Helper method to load an ExtensionAction from the page_action or | 551 // Helper method to load an ExtensionAction from the page_action or |
| 550 // browser_action entries in the manifest. | 552 // browser_action entries in the manifest. |
| 551 ExtensionAction* LoadExtensionActionHelper( | 553 ExtensionAction* LoadExtensionActionHelper( |
| 552 const DictionaryValue* extension_action, std::string* error); | 554 const DictionaryValue* extension_action, std::string* error); |
| 553 | 555 |
| 554 // Helper method to load an ExtensionSidebarDefaults from the sidebar manifest | 556 // Helper method to load an ExtensionSidebarDefaults from the sidebar manifest |
| 555 // entry. | 557 // entry. |
| 556 ExtensionSidebarDefaults* LoadExtensionSidebarDefaults( | 558 ExtensionSidebarDefaults* LoadExtensionSidebarDefaults( |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 // A copy of the manifest that this extension was created from. | 701 // A copy of the manifest that this extension was created from. |
| 700 scoped_ptr<DictionaryValue> manifest_value_; | 702 scoped_ptr<DictionaryValue> manifest_value_; |
| 701 | 703 |
| 702 // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs | 704 // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs |
| 703 // which override the handling of those URLs. (see ExtensionOverrideUI). | 705 // which override the handling of those URLs. (see ExtensionOverrideUI). |
| 704 URLOverrideMap chrome_url_overrides_; | 706 URLOverrideMap chrome_url_overrides_; |
| 705 | 707 |
| 706 // Whether this extension uses app features. | 708 // Whether this extension uses app features. |
| 707 bool is_app_; | 709 bool is_app_; |
| 708 | 710 |
| 711 // Whether this extension requests isolated storage. |
| 712 bool is_storage_isolated_; |
| 713 |
| 709 // The local path inside the extension to use with the launcher. | 714 // The local path inside the extension to use with the launcher. |
| 710 std::string launch_local_path_; | 715 std::string launch_local_path_; |
| 711 | 716 |
| 712 // A web url to use with the launcher. Note that this might be relative or | 717 // A web url to use with the launcher. Note that this might be relative or |
| 713 // absolute. If relative, it is relative to web_origin. | 718 // absolute. If relative, it is relative to web_origin. |
| 714 std::string launch_web_url_; | 719 std::string launch_web_url_; |
| 715 | 720 |
| 716 // The window type that an app's manifest specifies to launch into. | 721 // The window type that an app's manifest specifies to launch into. |
| 717 // This is not always the window type an app will open into, because | 722 // This is not always the window type an app will open into, because |
| 718 // users can override the way each app launches. See | 723 // users can override the way each app launches. See |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 // Was the extension already disabled? | 791 // Was the extension already disabled? |
| 787 bool already_disabled; | 792 bool already_disabled; |
| 788 | 793 |
| 789 // The extension being unloaded - this should always be non-NULL. | 794 // The extension being unloaded - this should always be non-NULL. |
| 790 const Extension* extension; | 795 const Extension* extension; |
| 791 | 796 |
| 792 UnloadedExtensionInfo(const Extension* extension, Reason reason); | 797 UnloadedExtensionInfo(const Extension* extension, Reason reason); |
| 793 }; | 798 }; |
| 794 | 799 |
| 795 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 800 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |