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

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

Issue 11568034: Changing inheritance to composition. (Closed) 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
« no previous file with comments | « chrome/common/extensions/features/manifest_feature.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/manifest_feature.h" 5 #include "chrome/common/extensions/features/manifest_feature.h"
6 6
7 #include "chrome/common/extensions/manifest.h" 7 #include "chrome/common/extensions/manifest.h"
8 8
9 namespace extensions { 9 namespace extensions {
10 10
11 ManifestFeature::ManifestFeature() { 11 ManifestFeature::ManifestFeature(scoped_ptr<Feature> feature)
12 : feature_(feature.Pass()) {
12 } 13 }
13 14
14 ManifestFeature::~ManifestFeature() { 15 ManifestFeature::~ManifestFeature() {
15 } 16 }
16 17
17 Feature::Availability ManifestFeature::IsAvailableToContext( 18 Feature::Availability ManifestFeature::IsAvailableToContext(
18 const Extension* extension, 19 const Extension* extension,
19 Feature::Context context, 20 Feature::Context context,
20 Feature::Platform platform) const { 21 Feature::Platform platform) const {
21 Availability availability = Feature::IsAvailableToContext(extension, 22 Availability availability = feature_->IsAvailableToContext(extension,
22 context, 23 context,
23 platform); 24 platform);
24 if (!availability.is_available()) 25 if (!availability.is_available())
25 return availability; 26 return availability;
26 27
27 // We know we can skip manifest()->GetKey() here because we just did the same 28 // We know we can skip manifest()->GetKey() here because we just did the same
28 // validation it would do above. 29 // validation it would do above.
29 if (!extension->manifest()->value()->HasKey(name())) 30 if (!extension->manifest()->value()->HasKey(name()))
30 return CreateAvailability(NOT_PRESENT, extension->GetType()); 31 return CreateAvailability(NOT_PRESENT, extension->GetType());
31 32
32 return CreateAvailability(IS_AVAILABLE); 33 return CreateAvailability(IS_AVAILABLE);
33 } 34 }
34 35
35 } // namespace 36 } // namespace
OLDNEW
« no previous file with comments | « chrome/common/extensions/features/manifest_feature.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698