OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/common/features/feature.h" | 5 #include "extensions/common/features/feature.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "extensions/common/extension.h" | 13 #include "extensions/common/extension.h" |
| 14 #include "extensions/common/manifest.h" |
14 | 15 |
15 namespace extensions { | 16 namespace extensions { |
16 | 17 |
17 // static | 18 // static |
18 Feature::Platform Feature::GetCurrentPlatform() { | 19 Feature::Platform Feature::GetCurrentPlatform() { |
19 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
20 return CHROMEOS_PLATFORM; | 21 return CHROMEOS_PLATFORM; |
21 #elif defined(OS_LINUX) | 22 #elif defined(OS_LINUX) |
22 return LINUX_PLATFORM; | 23 return LINUX_PLATFORM; |
23 #elif defined(OS_MACOSX) | 24 #elif defined(OS_MACOSX) |
(...skipping 12 matching lines...) Expand all Loading... |
36 } | 37 } |
37 | 38 |
38 Feature::Availability Feature::IsAvailableToExtension( | 39 Feature::Availability Feature::IsAvailableToExtension( |
39 const Extension* extension) { | 40 const Extension* extension) { |
40 return IsAvailableToManifest(extension->id(), | 41 return IsAvailableToManifest(extension->id(), |
41 extension->GetType(), | 42 extension->GetType(), |
42 extension->location(), | 43 extension->location(), |
43 extension->manifest_version()); | 44 extension->manifest_version()); |
44 } | 45 } |
45 | 46 |
| 47 Feature::Availability Feature::IsAvailableToEnvironment() const { |
| 48 return IsAvailableToManifest("", // extension_id |
| 49 Manifest::TYPE_UNKNOWN, |
| 50 Manifest::INVALID_LOCATION, |
| 51 -1); // manifest_version |
| 52 } |
| 53 |
46 Feature::Feature() : no_parent_(false) {} | 54 Feature::Feature() : no_parent_(false) {} |
47 | 55 |
48 Feature::~Feature() {} | 56 Feature::~Feature() {} |
49 | 57 |
50 } // namespace extensions | 58 } // namespace extensions |
OLD | NEW |