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 #include "chrome/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2828 } | 2828 } |
2829 | 2829 |
2830 bool Extension::ShowConfigureContextMenus() const { | 2830 bool Extension::ShowConfigureContextMenus() const { |
2831 // Don't show context menu for component extensions. We might want to show | 2831 // Don't show context menu for component extensions. We might want to show |
2832 // options for component extension button but now there is no component | 2832 // options for component extension button but now there is no component |
2833 // extension with options. All other menu items like uninstall have | 2833 // extension with options. All other menu items like uninstall have |
2834 // no sense for component extensions. | 2834 // no sense for component extensions. |
2835 return location() != Extension::COMPONENT; | 2835 return location() != Extension::COMPONENT; |
2836 } | 2836 } |
2837 | 2837 |
| 2838 bool Extension::ImplicitlyDelaysNetworkStartup() const { |
| 2839 // Network requests should be deferred until any extensions that might want |
| 2840 // to observe or modify them are loaded. |
| 2841 return HasAPIPermission(ExtensionAPIPermission::kWebNavigation) || |
| 2842 HasAPIPermission(ExtensionAPIPermission::kWebRequest); |
| 2843 } |
| 2844 |
2838 bool Extension::IsDisallowedExperimentalPermission( | 2845 bool Extension::IsDisallowedExperimentalPermission( |
2839 ExtensionAPIPermission::ID permission) const { | 2846 ExtensionAPIPermission::ID permission) const { |
2840 return permission == ExtensionAPIPermission::kExperimental && | 2847 return permission == ExtensionAPIPermission::kExperimental && |
2841 !CommandLine::ForCurrentProcess()->HasSwitch( | 2848 !CommandLine::ForCurrentProcess()->HasSwitch( |
2842 switches::kEnableExperimentalExtensionApis); | 2849 switches::kEnableExperimentalExtensionApis); |
2843 } | 2850 } |
2844 | 2851 |
2845 bool Extension::CanExecuteScriptEverywhere() const { | 2852 bool Extension::CanExecuteScriptEverywhere() const { |
2846 if (location() == Extension::COMPONENT | 2853 if (location() == Extension::COMPONENT |
2847 #ifndef NDEBUG | 2854 #ifndef NDEBUG |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2982 already_disabled(false), | 2989 already_disabled(false), |
2983 extension(extension) {} | 2990 extension(extension) {} |
2984 | 2991 |
2985 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 2992 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
2986 const Extension* extension, | 2993 const Extension* extension, |
2987 const ExtensionPermissionSet* permissions, | 2994 const ExtensionPermissionSet* permissions, |
2988 Reason reason) | 2995 Reason reason) |
2989 : reason(reason), | 2996 : reason(reason), |
2990 extension(extension), | 2997 extension(extension), |
2991 permissions(permissions) {} | 2998 permissions(permissions) {} |
OLD | NEW |