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 2739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2750 // Don't show context menu for component extensions. We might want to show | 2750 // Don't show context menu for component extensions. We might want to show |
2751 // options for component extension button but now there is no component | 2751 // options for component extension button but now there is no component |
2752 // extension with options. All other menu items like uninstall have | 2752 // extension with options. All other menu items like uninstall have |
2753 // no sense for component extensions. | 2753 // no sense for component extensions. |
2754 return location() != Extension::COMPONENT; | 2754 return location() != Extension::COMPONENT; |
2755 } | 2755 } |
2756 | 2756 |
2757 bool Extension::ImplicitlyDelaysNetworkStartup() const { | 2757 bool Extension::ImplicitlyDelaysNetworkStartup() const { |
2758 // Network requests should be deferred until any extensions that might want | 2758 // Network requests should be deferred until any extensions that might want |
2759 // to observe or modify them are loaded. | 2759 // to observe or modify them are loaded. |
2760 return HasAPIPermission(ExtensionAPIPermission::kWebNavigation) || | 2760 return HasAPIPermission(ExtensionAPIPermission::kWebRequest); |
Matt Perry
2011/12/12 20:29:55
Can you change this to kWebRequestBlocking while y
jochen (gone - plz use gerrit)
2011/12/12 20:42:59
If I do that, I can't merge anymore - M16 doesn't
Matt Perry
2011/12/12 21:08:40
Oh, is it still possible to merge to M16? If so, c
| |
2761 HasAPIPermission(ExtensionAPIPermission::kWebRequest); | |
2762 } | 2761 } |
2763 | 2762 |
2764 bool Extension::CanSpecifyAPIPermission( | 2763 bool Extension::CanSpecifyAPIPermission( |
2765 const ExtensionAPIPermission* permission, | 2764 const ExtensionAPIPermission* permission, |
2766 std::string* error) const { | 2765 std::string* error) const { |
2767 if (permission->is_component_only()) { | 2766 if (permission->is_component_only()) { |
2768 if (!CanSpecifyComponentOnlyPermission()) { | 2767 if (!CanSpecifyComponentOnlyPermission()) { |
2769 *error = ExtensionErrorUtils::FormatErrorMessage( | 2768 *error = ExtensionErrorUtils::FormatErrorMessage( |
2770 errors::kPermissionNotAllowed, permission->name()); | 2769 errors::kPermissionNotAllowed, permission->name()); |
2771 return false; | 2770 return false; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2982 already_disabled(false), | 2981 already_disabled(false), |
2983 extension(extension) {} | 2982 extension(extension) {} |
2984 | 2983 |
2985 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 2984 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
2986 const Extension* extension, | 2985 const Extension* extension, |
2987 const ExtensionPermissionSet* permissions, | 2986 const ExtensionPermissionSet* permissions, |
2988 Reason reason) | 2987 Reason reason) |
2989 : reason(reason), | 2988 : reason(reason), |
2990 extension(extension), | 2989 extension(extension), |
2991 permissions(permissions) {} | 2990 permissions(permissions) {} |
OLD | NEW |