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

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

Issue 9950046: Implement FeatureProvider for ExtensionAPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/common/extensions/permission_feature.h"
6
7 #include "chrome/common/extensions/extension_permission_set.h"
8
9 namespace extensions {
10
11 PermissionFeature::PermissionFeature() {
12 }
13
14 PermissionFeature::~PermissionFeature() {
15 }
16
17 Feature::Availability PermissionFeature::IsAvailableToContext(
18 const Extension* extension,
19 Feature::Context context,
20 Feature::Platform platform) const {
21 Availability availability = Feature::IsAvailableToContext(extension,
22 context,
23 platform);
24 if (availability != IS_AVAILABLE)
25 return availability;
26
27 if (!extension->HasAPIPermission(name()))
28 return NOT_PRESENT;
29
30 return IS_AVAILABLE;
31 }
32
33 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698