| 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 #ifndef EXTENSIONS_COMMON_FEATURES_FEATURE_H_ | 5 #ifndef EXTENSIONS_COMMON_FEATURES_FEATURE_H_ |
| 6 #define EXTENSIONS_COMMON_FEATURES_FEATURE_H_ | 6 #define EXTENSIONS_COMMON_FEATURES_FEATURE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // top-level manifest key, a permission, or a programmatic API. A feature can | 22 // top-level manifest key, a permission, or a programmatic API. A feature can |
| 23 // express requirements for where it can be accessed, and supports testing | 23 // express requirements for where it can be accessed, and supports testing |
| 24 // support for those requirements. If platforms are not specified, then feature | 24 // support for those requirements. If platforms are not specified, then feature |
| 25 // is available on all platforms. | 25 // is available on all platforms. |
| 26 class Feature { | 26 class Feature { |
| 27 public: | 27 public: |
| 28 // The JavaScript contexts the feature is supported in. | 28 // The JavaScript contexts the feature is supported in. |
| 29 enum Context { | 29 enum Context { |
| 30 UNSPECIFIED_CONTEXT, | 30 UNSPECIFIED_CONTEXT, |
| 31 | 31 |
| 32 // A context in a privileged extension process. | 32 // See chrome/common/extensions/api/_features.md for a description of these |
| 33 // contexts. |
| 33 BLESSED_EXTENSION_CONTEXT, | 34 BLESSED_EXTENSION_CONTEXT, |
| 34 | |
| 35 // A context in an unprivileged extension process. | |
| 36 UNBLESSED_EXTENSION_CONTEXT, | 35 UNBLESSED_EXTENSION_CONTEXT, |
| 37 | |
| 38 // A context from a content script. | |
| 39 CONTENT_SCRIPT_CONTEXT, | 36 CONTENT_SCRIPT_CONTEXT, |
| 40 | |
| 41 // A normal web page. This should have an associated URL matching pattern. | |
| 42 WEB_PAGE_CONTEXT, | 37 WEB_PAGE_CONTEXT, |
| 43 | |
| 44 // A web page context which has been blessed by the user. Typically this | |
| 45 // will be via the installation of a hosted app, so this may host an | |
| 46 // extension. This is not affected by the URL matching pattern. | |
| 47 BLESSED_WEB_PAGE_CONTEXT, | 38 BLESSED_WEB_PAGE_CONTEXT, |
| 48 | |
| 49 // A page within webui. | |
| 50 WEBUI_CONTEXT, | 39 WEBUI_CONTEXT, |
| 51 | |
| 52 // A context belonging to a service worker. | |
| 53 SERVICE_WORKER_CONTEXT, | 40 SERVICE_WORKER_CONTEXT, |
| 54 }; | 41 }; |
| 55 | 42 |
| 56 // The platforms the feature is supported in. | 43 // The platforms the feature is supported in. |
| 57 enum Platform { | 44 enum Platform { |
| 58 UNSPECIFIED_PLATFORM, | 45 UNSPECIFIED_PLATFORM, |
| 59 CHROMEOS_PLATFORM, | 46 CHROMEOS_PLATFORM, |
| 60 LINUX_PLATFORM, | 47 LINUX_PLATFORM, |
| 61 MACOSX_PLATFORM, | 48 MACOSX_PLATFORM, |
| 62 WIN_PLATFORM | 49 WIN_PLATFORM |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 protected: | 150 protected: |
| 164 std::string name_; | 151 std::string name_; |
| 165 bool no_parent_; | 152 bool no_parent_; |
| 166 // TODO(devlin): Remove this once we set the feature channel for tests. | 153 // TODO(devlin): Remove this once we set the feature channel for tests. |
| 167 bool check_channel_; | 154 bool check_channel_; |
| 168 }; | 155 }; |
| 169 | 156 |
| 170 } // namespace extensions | 157 } // namespace extensions |
| 171 | 158 |
| 172 #endif // EXTENSIONS_COMMON_FEATURES_FEATURE_H_ | 159 #endif // EXTENSIONS_COMMON_FEATURES_FEATURE_H_ |
| OLD | NEW |