| 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/features/permission_feature.h" | 5 #include "chrome/common/extensions/features/permission_feature.h" |
| 6 | 6 |
| 7 namespace extensions { | 7 namespace extensions { |
| 8 | 8 |
| 9 PermissionFeature::PermissionFeature() { | 9 PermissionFeature::PermissionFeature() { |
| 10 } | 10 } |
| 11 | 11 |
| 12 PermissionFeature::~PermissionFeature() { | 12 PermissionFeature::~PermissionFeature() { |
| 13 } | 13 } |
| 14 | 14 |
| 15 Feature::Availability PermissionFeature::IsAvailableToContext( | 15 Feature::Availability PermissionFeature::IsAvailableToContext( |
| 16 const Extension* extension, | 16 const Extension* extension, |
| 17 Feature::Context context, | 17 Feature::Context context, |
| 18 Feature::Platform platform) const { | 18 Feature::Platform platform) const { |
| 19 Availability availability = Feature::IsAvailableToContext(extension, | 19 Availability availability = SimpleFeature::IsAvailableToContext(extension, |
| 20 context, | 20 context, |
| 21 platform); | 21 platform); |
| 22 if (!availability.is_available()) | 22 if (!availability.is_available()) |
| 23 return availability; | 23 return availability; |
| 24 | 24 |
| 25 if (!extension->HasAPIPermission(name())) | 25 if (!extension->HasAPIPermission(name())) |
| 26 return CreateAvailability(NOT_PRESENT, extension->GetType()); | 26 return CreateAvailability(NOT_PRESENT, extension->GetType()); |
| 27 | 27 |
| 28 return CreateAvailability(IS_AVAILABLE); | 28 return CreateAvailability(IS_AVAILABLE); |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| OLD | NEW |