summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/features/feature.cc
blob: c245468ec8daad711d15f7aca9a5124954803d4a (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright (c) 2012 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 "chrome/common/extensions/features/feature.h"

#include <map>

#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/stringprintf.h"
#include "base/string_util.h"
#include "chrome/common/chrome_switches.h"

using chrome::VersionInfo;

namespace {

const VersionInfo::Channel kDefaultChannel = VersionInfo::CHANNEL_STABLE;
VersionInfo::Channel g_current_channel = kDefaultChannel;

}  // namespace

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
chrome::VersionInfo::Channel Feature::GetCurrentChannel() {
  return g_current_channel;
}

// static
void Feature::SetCurrentChannel(VersionInfo::Channel channel) {
  g_current_channel = channel;
}

// static
chrome::VersionInfo::Channel Feature::GetDefaultChannel() {
  return kDefaultChannel;
}

Feature::~Feature() {}

}  // namespace extensions