ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / extensions / common / features / feature.cc
blob8fadf4f8b45c6a1ad465a4f803cc340961d03208
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"
14 #include "extensions/common/manifest.h"
16 namespace extensions {
18 // static
19 Feature::Platform Feature::GetCurrentPlatform() {
20 #if defined(OS_CHROMEOS)
21 return CHROMEOS_PLATFORM;
22 #elif defined(OS_LINUX)
23 return LINUX_PLATFORM;
24 #elif defined(OS_MACOSX)
25 return MACOSX_PLATFORM;
26 #elif defined(OS_WIN)
27 return WIN_PLATFORM;
28 #else
29 return UNSPECIFIED_PLATFORM;
30 #endif
33 // static
34 Feature::Availability Feature::CreateAvailability(AvailabilityResult result,
35 const std::string& message) {
36 return Availability(result, message);
39 Feature::Availability Feature::IsAvailableToExtension(
40 const Extension* extension) const {
41 return IsAvailableToManifest(extension->id(),
42 extension->GetType(),
43 extension->location(),
44 extension->manifest_version());
47 Feature::Availability Feature::IsAvailableToEnvironment() const {
48 return IsAvailableToManifest("", // extension_id
49 Manifest::TYPE_UNKNOWN,
50 Manifest::INVALID_LOCATION,
51 -1); // manifest_version
54 Feature::Feature() : no_parent_(false) {}
56 Feature::~Feature() {}
58 } // namespace extensions