Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: chrome/common/extensions/features/permission_feature.cc

Issue 11585003: Make Manifest/Permission Features Compose with Feature Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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(Feature* feature)
10 : feature_(feature) {
10 } 11 }
11 12
12 PermissionFeature::~PermissionFeature() { 13 PermissionFeature::~PermissionFeature() {
13 } 14 }
14 15
15 Feature::Availability PermissionFeature::IsAvailableToContext( 16 Feature::Availability PermissionFeature::IsAvailableToContext(
16 const Extension* extension, 17 const Extension* extension,
17 Feature::Context context, 18 Feature::Context context,
18 Feature::Platform platform) const { 19 Feature::Platform platform) const {
19 Availability availability = SimpleFeature::IsAvailableToContext(extension, 20 Availability availability = feature_->IsAvailableToContext(extension,
20 context, 21 context,
21 platform); 22 platform);
22 if (!availability.is_available()) 23 if (!availability.is_available())
23 return availability; 24 return availability;
24 25
25 if (!extension->HasAPIPermission(name())) 26 if (!extension->HasAPIPermission(name()))
26 return CreateAvailability(NOT_PRESENT, extension->GetType()); 27 return CreateAvailability(NOT_PRESENT, extension->GetType());
27 28
28 return CreateAvailability(IS_AVAILABLE); 29 return CreateAvailability(IS_AVAILABLE);
29 } 30 }
30 31
31 } // namespace 32 } // namespace
OLDNEW
« no previous file with comments | « chrome/common/extensions/features/permission_feature.h ('k') | chrome/common/extensions/features/simple_feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698