mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 70.0.3538.0 (#587811)
Known issues: - The CefLoadCRLSetsFile function needs to be re-implemented (see issue #2497). - Linux: GTK2 support has been removed. The cefclient sample needs to be updated to use GTK3 (see issue #2014).
This commit is contained in:
89
libcef/common/extensions/extensions_api_provider.cc
Normal file
89
libcef/common/extensions/extensions_api_provider.cc
Normal file
@ -0,0 +1,89 @@
|
||||
// Copyright 2018 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "libcef/common/extensions/extensions_api_provider.h"
|
||||
|
||||
#include "libcef/common/extensions/chrome_generated_schemas.h"
|
||||
|
||||
#include "cef/grit/cef_resources.h"
|
||||
//#include "cef/libcef/common/extensions/api/generated_schemas.h"
|
||||
#include "cef/libcef/common/extensions/api/cef_api_features.h"
|
||||
#include "cef/libcef/common/extensions/api/cef_manifest_features.h"
|
||||
#include "cef/libcef/common/extensions/api/cef_permission_features.h"
|
||||
#include "chrome/common/extensions/chrome_aliases.h"
|
||||
#include "chrome/common/extensions/chrome_manifest_handlers.h"
|
||||
#include "extensions/common/features/json_feature_provider_source.h"
|
||||
#include "extensions/common/permissions/permissions_info.h"
|
||||
|
||||
namespace extensions {
|
||||
|
||||
CefExtensionsAPIProvider::CefExtensionsAPIProvider() {
|
||||
}
|
||||
|
||||
void CefExtensionsAPIProvider::AddAPIFeatures(FeatureProvider* provider) {
|
||||
AddCEFAPIFeatures(provider);
|
||||
}
|
||||
|
||||
void CefExtensionsAPIProvider::AddManifestFeatures(
|
||||
FeatureProvider* provider) {
|
||||
AddCEFManifestFeatures(provider);
|
||||
}
|
||||
|
||||
void CefExtensionsAPIProvider::AddPermissionFeatures(
|
||||
FeatureProvider* provider) {
|
||||
AddCEFPermissionFeatures(provider);
|
||||
}
|
||||
|
||||
void CefExtensionsAPIProvider::AddBehaviorFeatures(
|
||||
FeatureProvider* provider) {
|
||||
// No CEF-specific behavior features.
|
||||
}
|
||||
|
||||
void CefExtensionsAPIProvider::AddAPIJSONSources(
|
||||
JSONFeatureProviderSource* json_source) {
|
||||
// Extension API features specific to CEF. See
|
||||
// libcef/common/extensions/api/README.txt for additional details.
|
||||
json_source->LoadJSON(IDR_CEF_EXTENSION_API_FEATURES);
|
||||
}
|
||||
|
||||
bool CefExtensionsAPIProvider::IsAPISchemaGenerated(const std::string& name) {
|
||||
// Schema for CEF-only APIs.
|
||||
// TODO(cef): Enable if/when CEF exposes its own Mojo APIs. See
|
||||
// libcef/common/extensions/api/README.txt for details.
|
||||
// if (api::cef::CefGeneratedSchemas::IsGenerated(name))
|
||||
// return true;
|
||||
|
||||
// Chrome APIs whitelisted by CEF.
|
||||
if (api::cef::ChromeGeneratedSchemas::IsGenerated(name))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
base::StringPiece CefExtensionsAPIProvider::GetAPISchema(
|
||||
const std::string& name) {
|
||||
// Schema for CEF-only APIs.
|
||||
// TODO(cef): Enable if/when CEF exposes its own Mojo APIs. See
|
||||
// libcef/common/extensions/api/README.txt for details.
|
||||
// if (api::cef::CefGeneratedSchemas::IsGenerated(name))
|
||||
// return api::cef::CefGeneratedSchemas::Get(name);
|
||||
|
||||
// Chrome APIs whitelisted by CEF.
|
||||
if (api::cef::ChromeGeneratedSchemas::IsGenerated(name))
|
||||
return api::cef::ChromeGeneratedSchemas::Get(name);
|
||||
|
||||
return base::StringPiece();
|
||||
}
|
||||
|
||||
void CefExtensionsAPIProvider::AddPermissionsProviders(
|
||||
PermissionsInfo* permissions_info) {
|
||||
permissions_info->AddProvider(chrome_api_permissions_,
|
||||
GetChromePermissionAliases());
|
||||
}
|
||||
|
||||
void CefExtensionsAPIProvider::RegisterManifestHandlers() {
|
||||
RegisterChromeManifestHandlers();
|
||||
}
|
||||
|
||||
} // namespace extensions
|
Reference in New Issue
Block a user