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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 bool is_hosted_app() const; | 604 bool is_hosted_app() const; |
605 bool is_packaged_app() const; | 605 bool is_packaged_app() const; |
606 bool is_storage_isolated() const { return is_app() && is_storage_isolated_; } | 606 bool is_storage_isolated() const { return is_app() && is_storage_isolated_; } |
607 const URLPatternSet& web_extent() const { return extent_; } | 607 const URLPatternSet& web_extent() const { return extent_; } |
608 const std::string& launch_local_path() const { return launch_local_path_; } | 608 const std::string& launch_local_path() const { return launch_local_path_; } |
609 const std::string& launch_web_url() const { return launch_web_url_; } | 609 const std::string& launch_web_url() const { return launch_web_url_; } |
610 extension_misc::LaunchContainer launch_container() const { | 610 extension_misc::LaunchContainer launch_container() const { |
611 return launch_container_; | 611 return launch_container_; |
612 } | 612 } |
613 int launch_width() const { | 613 int launch_width() const { |
614 return std::max(launch_min_width_, launch_width_); | 614 return std::max(launch_min_width_, |
| 615 launch_max_width_ ? |
| 616 std::min(launch_max_width_, launch_width_) : |
| 617 launch_width_); |
615 } | 618 } |
616 int launch_height() const { | 619 int launch_height() const { |
617 return std::max(launch_min_height_, launch_height_); | 620 return std::max(launch_min_height_, |
| 621 launch_max_height_ ? |
| 622 std::min(launch_max_height_, launch_height_) : |
| 623 launch_height_); |
618 } | 624 } |
619 int launch_min_width() const { return launch_min_width_; } | 625 int launch_min_width() const { return launch_min_width_; } |
620 int launch_min_height() const { return launch_min_height_; } | 626 int launch_min_height() const { return launch_min_height_; } |
| 627 int launch_max_width() const { return launch_max_width_; } |
| 628 int launch_max_height() const { return launch_max_height_; } |
621 | 629 |
622 // Theme-related. | 630 // Theme-related. |
623 bool is_theme() const; | 631 bool is_theme() const; |
624 base::DictionaryValue* GetThemeImages() const { return theme_images_.get(); } | 632 base::DictionaryValue* GetThemeImages() const { return theme_images_.get(); } |
625 base::DictionaryValue* GetThemeColors() const {return theme_colors_.get(); } | 633 base::DictionaryValue* GetThemeColors() const {return theme_colors_.get(); } |
626 base::DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } | 634 base::DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } |
627 base::DictionaryValue* GetThemeDisplayProperties() const { | 635 base::DictionaryValue* GetThemeDisplayProperties() const { |
628 return theme_display_properties_.get(); | 636 return theme_display_properties_.get(); |
629 } | 637 } |
630 | 638 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 // users can override the way each app launches. See | 915 // users can override the way each app launches. See |
908 // ExtensionPrefs::GetLaunchContainer(), which looks at a per-app pref | 916 // ExtensionPrefs::GetLaunchContainer(), which looks at a per-app pref |
909 // to decide what container an app will launch in. | 917 // to decide what container an app will launch in. |
910 extension_misc::LaunchContainer launch_container_; | 918 extension_misc::LaunchContainer launch_container_; |
911 | 919 |
912 // The default size of the container when launching. Only respected for | 920 // The default size of the container when launching. Only respected for |
913 // containers like panels and windows. | 921 // containers like panels and windows. |
914 int launch_width_; | 922 int launch_width_; |
915 int launch_height_; | 923 int launch_height_; |
916 | 924 |
917 // The minimum size of the container. Only respected for the shell container. | 925 // The minimum and maximum size of the container. Only respected for the |
| 926 // shell container. |
918 int launch_min_width_; | 927 int launch_min_width_; |
919 int launch_min_height_; | 928 int launch_min_height_; |
| 929 int launch_max_width_; |
| 930 int launch_max_height_; |
920 | 931 |
921 // The Omnibox keyword for this extension, or empty if there is none. | 932 // The Omnibox keyword for this extension, or empty if there is none. |
922 std::string omnibox_keyword_; | 933 std::string omnibox_keyword_; |
923 | 934 |
924 // List of text-to-speech voices that this extension provides, if any. | 935 // List of text-to-speech voices that this extension provides, if any. |
925 std::vector<TtsVoice> tts_voices_; | 936 std::vector<TtsVoice> tts_voices_; |
926 | 937 |
927 // List of intent services that this extension provides, if any. | 938 // List of intent services that this extension provides, if any. |
928 std::vector<webkit_glue::WebIntentServiceData> intents_services_; | 939 std::vector<webkit_glue::WebIntentServiceData> intents_services_; |
929 | 940 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 // only contain the removed permissions. | 1008 // only contain the removed permissions. |
998 const ExtensionPermissionSet* permissions; | 1009 const ExtensionPermissionSet* permissions; |
999 | 1010 |
1000 UpdatedExtensionPermissionsInfo( | 1011 UpdatedExtensionPermissionsInfo( |
1001 const Extension* extension, | 1012 const Extension* extension, |
1002 const ExtensionPermissionSet* permissions, | 1013 const ExtensionPermissionSet* permissions, |
1003 Reason reason); | 1014 Reason reason); |
1004 }; | 1015 }; |
1005 | 1016 |
1006 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1017 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |