| 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/extension_api.h" | 5 #include "extensions/common/extension_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 schemas_[schema_namespace] = std::move(schema_dict); | 150 schemas_[schema_namespace] = std::move(schema_dict); |
| 151 } | 151 } |
| 152 | 152 |
| 153 ExtensionAPI::ExtensionAPI() : default_configuration_initialized_(false) { | 153 ExtensionAPI::ExtensionAPI() : default_configuration_initialized_(false) { |
| 154 } | 154 } |
| 155 | 155 |
| 156 ExtensionAPI::~ExtensionAPI() { | 156 ExtensionAPI::~ExtensionAPI() { |
| 157 } | 157 } |
| 158 | 158 |
| 159 void ExtensionAPI::InitDefaultConfiguration() { | 159 void ExtensionAPI::InitDefaultConfiguration() { |
| 160 const char* names[] = {"api", "manifest", "permission"}; | 160 const char* names[] = {"api", "behavior", "manifest", "permission"}; |
| 161 for (size_t i = 0; i < arraysize(names); ++i) | 161 for (size_t i = 0; i < arraysize(names); ++i) |
| 162 RegisterDependencyProvider(names[i], FeatureProvider::GetByName(names[i])); | 162 RegisterDependencyProvider(names[i], FeatureProvider::GetByName(names[i])); |
| 163 | 163 |
| 164 default_configuration_initialized_ = true; | 164 default_configuration_initialized_ = true; |
| 165 } | 165 } |
| 166 | 166 |
| 167 void ExtensionAPI::RegisterDependencyProvider(const std::string& name, | 167 void ExtensionAPI::RegisterDependencyProvider(const std::string& name, |
| 168 const FeatureProvider* provider) { | 168 const FeatureProvider* provider) { |
| 169 dependency_providers_[name] = provider; | 169 dependency_providers_[name] = provider; |
| 170 } | 170 } |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 if (!alias_feature) | 355 if (!alias_feature) |
| 356 alias_feature = provider->second->GetFeature(alias); | 356 alias_feature = provider->second->GetFeature(alias); |
| 357 | 357 |
| 358 CHECK(alias_feature) << "Cannot find alias feature " << alias | 358 CHECK(alias_feature) << "Cannot find alias feature " << alias |
| 359 << " for API feature " << feature->name(); | 359 << " for API feature " << feature->name(); |
| 360 | 360 |
| 361 return alias_feature->IsAvailableToContext(extension, context, url); | 361 return alias_feature->IsAvailableToContext(extension, context, url); |
| 362 } | 362 } |
| 363 | 363 |
| 364 } // namespace extensions | 364 } // namespace extensions |
| OLD | NEW |