- add sources.
[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
14 namespace extensions {
15
16 // static
17 Feature::Platform Feature::GetCurrentPlatform() {
18 #if defined(OS_CHROMEOS)
19   return CHROMEOS_PLATFORM;
20 #elif defined(OS_LINUX)
21   return LINUX_PLATFORM;
22 #elif defined(OS_MACOSX)
23   return MACOSX_PLATFORM;
24 #elif defined(OS_WIN)
25   return WIN_PLATFORM;
26 #else
27   return UNSPECIFIED_PLATFORM;
28 #endif
29 }
30
31 // static
32 Feature::Location Feature::ConvertLocation(Manifest::Location location) {
33   if (location == Manifest::COMPONENT)
34     return COMPONENT_LOCATION;
35   else
36     return UNSPECIFIED_LOCATION;
37 }
38
39 // static
40 Feature::Availability Feature::CreateAvailability(AvailabilityResult result,
41                                                   const std::string& message) {
42   return Availability(result, message);
43 }
44
45 Feature::Feature() : no_parent_(false) {}
46
47 Feature::~Feature() {}
48
49 }  // namespace extensions