Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / extensions / common / features / feature.cc
blobe06a44a8727b122aca2f15f01f10c1b84df56759
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"
7 #include <map>
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"
15 namespace extensions {
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
32 // static
33 Feature::Availability Feature::CreateAvailability(AvailabilityResult result,
34 const std::string& message) {
35 return Availability(result, message);
38 Feature::Availability Feature::IsAvailableToExtension(
39 const Extension* extension) {
40 return IsAvailableToManifest(extension->id(),
41 extension->GetType(),
42 extension->location(),
43 extension->manifest_version());
46 Feature::Feature() : no_parent_(false) {}
48 Feature::~Feature() {}
50 } // namespace extensions