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 "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 3474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3485 // show packaged apps and platform apps because there are some pieces of | 3485 // show packaged apps and platform apps because there are some pieces of |
3486 // functionality that are only available in chrome://extensions/ but which | 3486 // functionality that are only available in chrome://extensions/ but which |
3487 // are needed for packaged and platform apps. For example, inspecting | 3487 // are needed for packaged and platform apps. For example, inspecting |
3488 // background pages. See http://crbug.com/116134. | 3488 // background pages. See http://crbug.com/116134. |
3489 if (is_hosted_app()) | 3489 if (is_hosted_app()) |
3490 return false; | 3490 return false; |
3491 | 3491 |
3492 return true; | 3492 return true; |
3493 } | 3493 } |
3494 | 3494 |
| 3495 bool Extension::HasContentScriptAtURL(const GURL& url) const { |
| 3496 for (UserScriptList::const_iterator it = content_scripts_.begin(); |
| 3497 it != content_scripts_.end(); ++it) { |
| 3498 if (it->MatchesURL(url)) |
| 3499 return true; |
| 3500 } |
| 3501 return false; |
| 3502 } |
| 3503 |
3495 bool Extension::CheckPlatformAppFeatures(std::string* utf8_error) { | 3504 bool Extension::CheckPlatformAppFeatures(std::string* utf8_error) { |
3496 if (!is_platform_app()) | 3505 if (!is_platform_app()) |
3497 return true; | 3506 return true; |
3498 | 3507 |
3499 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 3508 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
3500 switches::kEnablePlatformApps)) { | 3509 switches::kEnablePlatformApps)) { |
3501 *utf8_error = errors::kPlatformAppFlagRequired; | 3510 *utf8_error = errors::kPlatformAppFlagRequired; |
3502 return false; | 3511 return false; |
3503 } | 3512 } |
3504 | 3513 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3544 already_disabled(false), | 3553 already_disabled(false), |
3545 extension(extension) {} | 3554 extension(extension) {} |
3546 | 3555 |
3547 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3556 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
3548 const Extension* extension, | 3557 const Extension* extension, |
3549 const ExtensionPermissionSet* permissions, | 3558 const ExtensionPermissionSet* permissions, |
3550 Reason reason) | 3559 Reason reason) |
3551 : reason(reason), | 3560 : reason(reason), |
3552 extension(extension), | 3561 extension(extension), |
3553 permissions(permissions) {} | 3562 permissions(permissions) {} |
OLD | NEW |