Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / extensions / common / features / feature.cc
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.
4
5 #include "extensions/common/features/feature.h"
6
7 #include <map>
8
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
15 namespace extensions {
16
17 // static
18 Feature::Platform Feature::GetCurrentPlatform() {
19 #if defined(OS_CHROMEOS)
20   return CHROMEOS_PLATFORM;
21 #elif defined(OS_LINUX)
22   return LINUX_PLATFORM;
23 #elif defined(OS_MACOSX)
24   return MACOSX_PLATFORM;
25 #elif defined(OS_WIN)
26   return WIN_PLATFORM;
27 #else
28   return UNSPECIFIED_PLATFORM;
29 #endif
30 }
31
32 // static
33 Feature::Availability Feature::CreateAvailability(AvailabilityResult result,
34                                                   const std::string& message) {
35   return Availability(result, message);
36 }
37
38 Feature::Availability Feature::IsAvailableToExtension(
39     const Extension* extension) {
40   return IsAvailableToManifest(extension->id(),
41                                extension->GetType(),
42                                extension->location(),
43                                extension->manifest_version());
44 }
45
46 Feature::Feature() : no_parent_(false) {}
47
48 Feature::~Feature() {}
49
50 }  // namespace extensions