| 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 #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 2647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2658 // TODO(skerner): Consider showing the reason |permission_str| is not | 2658 // TODO(skerner): Consider showing the reason |permission_str| is not |
| 2659 // a valid URL pattern if it is almost valid. For example, if it has | 2659 // a valid URL pattern if it is almost valid. For example, if it has |
| 2660 // a valid scheme, and failed to parse because it has a port, show an | 2660 // a valid scheme, and failed to parse because it has a port, show an |
| 2661 // error. | 2661 // error. |
| 2662 } | 2662 } |
| 2663 } | 2663 } |
| 2664 return true; | 2664 return true; |
| 2665 } | 2665 } |
| 2666 | 2666 |
| 2667 bool Extension::CanSilentlyIncreasePermissions() const { | 2667 bool Extension::CanSilentlyIncreasePermissions() const { |
| 2668 return location() != INTERNAL && location() != LOAD; | 2668 return location() != INTERNAL; |
| 2669 } | 2669 } |
| 2670 | 2670 |
| 2671 bool Extension::CanSpecifyHostPermission(const URLPattern& pattern, | 2671 bool Extension::CanSpecifyHostPermission(const URLPattern& pattern, |
| 2672 const ExtensionAPIPermissionSet& permissions) const { | 2672 const ExtensionAPIPermissionSet& permissions) const { |
| 2673 if (!pattern.match_all_urls() && | 2673 if (!pattern.match_all_urls() && |
| 2674 pattern.MatchesScheme(chrome::kChromeUIScheme)) { | 2674 pattern.MatchesScheme(chrome::kChromeUIScheme)) { |
| 2675 // Regular extensions are only allowed access to chrome://favicon. | 2675 // Regular extensions are only allowed access to chrome://favicon. |
| 2676 if (pattern.host() == chrome::kChromeUIFaviconHost) | 2676 if (pattern.host() == chrome::kChromeUIFaviconHost) |
| 2677 return true; | 2677 return true; |
| 2678 | 2678 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3047 already_disabled(false), | 3047 already_disabled(false), |
| 3048 extension(extension) {} | 3048 extension(extension) {} |
| 3049 | 3049 |
| 3050 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3050 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 3051 const Extension* extension, | 3051 const Extension* extension, |
| 3052 const ExtensionPermissionSet* permissions, | 3052 const ExtensionPermissionSet* permissions, |
| 3053 Reason reason) | 3053 Reason reason) |
| 3054 : reason(reason), | 3054 : reason(reason), |
| 3055 extension(extension), | 3055 extension(extension), |
| 3056 permissions(permissions) {} | 3056 permissions(permissions) {} |
| OLD | NEW |