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 #include "extensions/common/extension.h" 14 15 namespace extensions { 16 17 // static GetCurrentPlatform()18Feature::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 30 } 31 32 // static CreateAvailability(AvailabilityResult result,const std::string & message)33Feature::Availability Feature::CreateAvailability(AvailabilityResult result, 34 const std::string& message) { 35 return Availability(result, message); 36 } 37 IsAvailableToExtension(const Extension * extension)38Feature::Availability Feature::IsAvailableToExtension( 39 const Extension* extension) { 40 return IsAvailableToManifest(extension->id(), 41 extension->GetType(), 42 extension->location(), 43 extension->manifest_version()); 44 } 45 Feature()46Feature::Feature() : no_parent_(false) {} 47 ~Feature()48Feature::~Feature() {} 49 50 } // namespace extensions 51