1 // Copyright 2013 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.
5 #include "extensions/common/features/feature.h"
9 #include "base/command_line.h"
10 #include "base/lazy_instance.h"
11 #include "base/strings/string_util.h"
12 #include "base/strings/stringprintf.h"
13 #include "extensions/common/extension.h"
14 #include "extensions/common/manifest.h"
16 namespace extensions
{
19 Feature::Platform
Feature::GetCurrentPlatform() {
20 #if defined(OS_CHROMEOS)
21 return CHROMEOS_PLATFORM
;
22 #elif defined(OS_LINUX)
23 return LINUX_PLATFORM
;
24 #elif defined(OS_MACOSX)
25 return MACOSX_PLATFORM
;
29 return UNSPECIFIED_PLATFORM
;
33 Feature::Availability
Feature::IsAvailableToExtension(
34 const Extension
* extension
) const {
35 return IsAvailableToManifest(extension
->id(),
37 extension
->location(),
38 extension
->manifest_version());
41 Feature::Availability
Feature::IsAvailableToEnvironment() const {
42 return IsAvailableToManifest("", // extension_id
43 Manifest::TYPE_UNKNOWN
,
44 Manifest::INVALID_LOCATION
,
45 -1); // manifest_version
48 Feature::Feature() : no_parent_(false) {}
50 Feature::~Feature() {}
52 } // namespace extensions