OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/renderer/js_extension_bindings_system.h" | 5 #include "extensions/renderer/js_extension_bindings_system.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "content/public/child/v8_value_converter.h" | 9 #include "content/public/child/v8_value_converter.h" |
10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 RegisterBinding("runtime", "runtime", context); | 188 RegisterBinding("runtime", "runtime", context); |
189 break; | 189 break; |
190 | 190 |
191 case Feature::SERVICE_WORKER_CONTEXT: | 191 case Feature::SERVICE_WORKER_CONTEXT: |
192 DCHECK(ExtensionsClient::Get() | 192 DCHECK(ExtensionsClient::Get() |
193 ->ExtensionAPIEnabledInExtensionServiceWorkers()); | 193 ->ExtensionAPIEnabledInExtensionServiceWorkers()); |
194 // Intentional fallthrough. | 194 // Intentional fallthrough. |
195 case Feature::BLESSED_EXTENSION_CONTEXT: | 195 case Feature::BLESSED_EXTENSION_CONTEXT: |
196 case Feature::UNBLESSED_EXTENSION_CONTEXT: | 196 case Feature::UNBLESSED_EXTENSION_CONTEXT: |
197 case Feature::CONTENT_SCRIPT_CONTEXT: | 197 case Feature::CONTENT_SCRIPT_CONTEXT: |
| 198 case Feature::LOCK_SCREEN_EXTENSION_CONTEXT: |
198 case Feature::WEBUI_CONTEXT: { | 199 case Feature::WEBUI_CONTEXT: { |
199 // Extension context; iterate through all the APIs and bind the available | 200 // Extension context; iterate through all the APIs and bind the available |
200 // ones. | 201 // ones. |
201 const FeatureProvider* api_feature_provider = | 202 const FeatureProvider* api_feature_provider = |
202 FeatureProvider::GetAPIFeatures(); | 203 FeatureProvider::GetAPIFeatures(); |
203 for (const auto& map_entry : api_feature_provider->GetAllFeatures()) { | 204 for (const auto& map_entry : api_feature_provider->GetAllFeatures()) { |
204 // Internal APIs are included via require(api_name) from internal code | 205 // Internal APIs are included via require(api_name) from internal code |
205 // rather than chrome[api_name]. | 206 // rather than chrome[api_name]. |
206 if (map_entry.second->IsInternal()) | 207 if (map_entry.second->IsInternal()) |
207 continue; | 208 continue; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 std::unique_ptr<NativeHandler>( | 311 std::unique_ptr<NativeHandler>( |
311 new BindingGeneratingNativeHandler(context, api_name, "binding"))); | 312 new BindingGeneratingNativeHandler(context, api_name, "binding"))); |
312 module_system->SetNativeLazyField(bind_object, bind_name, api_bind_name, | 313 module_system->SetNativeLazyField(bind_object, bind_name, api_bind_name, |
313 "binding"); | 314 "binding"); |
314 } else { | 315 } else { |
315 module_system->SetLazyField(bind_object, bind_name, api_name, "binding"); | 316 module_system->SetLazyField(bind_object, bind_name, api_name, "binding"); |
316 } | 317 } |
317 } | 318 } |
318 | 319 |
319 } // namespace extensions | 320 } // namespace extensions |
OLD | NEW |