summaryrefslogtreecommitdiffstats
path: root/extensions/common/features/feature.cc
blob: 705f3e5ab850502de0c7fbb65340c8e8ab889641 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "extensions/common/features/feature.h"

#include <map>

#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"

namespace extensions {

// static
Feature::Platform Feature::GetCurrentPlatform() {
#if defined(OS_CHROMEOS)
  return CHROMEOS_PLATFORM;
#else
  return UNSPECIFIED_PLATFORM;
#endif
}

// static
Feature::Location Feature::ConvertLocation(Manifest::Location location) {
  if (location == Manifest::COMPONENT)
    return COMPONENT_LOCATION;
  else
    return UNSPECIFIED_LOCATION;
}

// static
Feature::Availability Feature::CreateAvailability(AvailabilityResult result,
                                                  const std::string& message) {
  return Availability(result, message);
}

Feature::Feature() : no_parent_(false) {}

Feature::~Feature() {}

}  // namespace extensions