2015-07-16 23:40:01 +02:00
|
|
|
// Copyright 2015 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions copyright 2014 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.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_COMMON_EXTENSIONS_EXTENSIONS_CLIENT_H_
|
|
|
|
#define CEF_LIBCEF_COMMON_EXTENSIONS_EXTENSIONS_CLIENT_H_
|
|
|
|
|
2016-07-20 20:03:38 +02:00
|
|
|
#include "chrome/common/extensions/permissions/chrome_permission_message_provider.h"
|
2015-07-16 23:40:01 +02:00
|
|
|
#include "extensions/common/extensions_client.h"
|
2016-11-23 21:54:29 +01:00
|
|
|
#include "url/gurl.h"
|
2015-07-16 23:40:01 +02:00
|
|
|
|
|
|
|
namespace extensions {
|
|
|
|
|
|
|
|
// The CEF implementation of ExtensionsClient.
|
|
|
|
class CefExtensionsClient : public ExtensionsClient {
|
|
|
|
public:
|
|
|
|
CefExtensionsClient();
|
2021-12-06 21:40:25 +01:00
|
|
|
|
|
|
|
CefExtensionsClient(const CefExtensionsClient&) = delete;
|
|
|
|
CefExtensionsClient& operator=(const CefExtensionsClient&) = delete;
|
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
~CefExtensionsClient() override;
|
|
|
|
|
|
|
|
// ExtensionsClient overrides:
|
|
|
|
void Initialize() override;
|
2017-10-20 19:45:20 +02:00
|
|
|
void InitializeWebStoreUrls(base::CommandLine* command_line) override;
|
2015-07-16 23:40:01 +02:00
|
|
|
const PermissionMessageProvider& GetPermissionMessageProvider()
|
|
|
|
const override;
|
|
|
|
const std::string GetProductName() override;
|
|
|
|
void FilterHostPermissions(const URLPatternSet& hosts,
|
|
|
|
URLPatternSet* new_hosts,
|
|
|
|
PermissionIDSet* permissions) const override;
|
2020-08-29 00:39:23 +02:00
|
|
|
void SetScriptingAllowlist(const ScriptingAllowlist& allowlist) override;
|
|
|
|
const ScriptingAllowlist& GetScriptingAllowlist() const override;
|
2015-07-16 23:40:01 +02:00
|
|
|
URLPatternSet GetPermittedChromeSchemeHosts(
|
|
|
|
const Extension* extension,
|
|
|
|
const APIPermissionSet& api_permissions) const override;
|
|
|
|
bool IsScriptableURL(const GURL& url, std::string* error) const override;
|
2017-01-23 18:36:54 +01:00
|
|
|
const GURL& GetWebstoreBaseURL() const override;
|
2016-11-23 21:54:29 +01:00
|
|
|
const GURL& GetWebstoreUpdateURL() const override;
|
2022-01-25 21:26:51 +01:00
|
|
|
bool IsBlocklistUpdateURL(const GURL& url) const override;
|
2015-07-16 23:40:01 +02:00
|
|
|
|
|
|
|
private:
|
2016-07-20 20:03:38 +02:00
|
|
|
const ChromePermissionMessageProvider permission_message_provider_;
|
2015-07-16 23:40:01 +02:00
|
|
|
|
2020-08-29 00:39:23 +02:00
|
|
|
ScriptingAllowlist scripting_allowlist_;
|
2015-07-16 23:40:01 +02:00
|
|
|
|
2016-11-23 21:54:29 +01:00
|
|
|
// Mutable to allow caching in a const method.
|
2017-01-23 18:36:54 +01:00
|
|
|
const GURL webstore_base_url_;
|
|
|
|
const GURL webstore_update_url_;
|
2015-07-16 23:40:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace extensions
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_COMMON_EXTENSIONS_EXTENSIONS_CLIENT_H_
|