feat: enable native extensions support (#21814)
This commit is contained in:
parent
bdf65a75d0
commit
a061c87e56
61 changed files with 1054 additions and 941 deletions
|
@ -0,0 +1,51 @@
|
|||
// Copyright (c) 2017 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef SHELL_RENDERER_EXTENSIONS_ELECTRON_EXTENSIONS_RENDERER_CLIENT_H_
|
||||
#define SHELL_RENDERER_EXTENSIONS_ELECTRON_EXTENSIONS_RENDERER_CLIENT_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "extensions/renderer/extensions_renderer_client.h"
|
||||
|
||||
namespace content {
|
||||
class RenderFrame;
|
||||
}
|
||||
|
||||
namespace extensions {
|
||||
class Dispatcher;
|
||||
}
|
||||
|
||||
namespace electron {
|
||||
|
||||
class ElectronExtensionsRendererClient
|
||||
: public extensions::ExtensionsRendererClient {
|
||||
public:
|
||||
ElectronExtensionsRendererClient();
|
||||
~ElectronExtensionsRendererClient() override;
|
||||
|
||||
// ExtensionsRendererClient implementation.
|
||||
bool IsIncognitoProcess() const override;
|
||||
int GetLowestIsolatedWorldId() const override;
|
||||
extensions::Dispatcher* GetDispatcher() override;
|
||||
bool ExtensionAPIEnabledForServiceWorkerScript(
|
||||
const GURL& scope,
|
||||
const GURL& script_url) const override;
|
||||
|
||||
bool AllowPopup();
|
||||
|
||||
void RunScriptsAtDocumentStart(content::RenderFrame* render_frame);
|
||||
void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame);
|
||||
void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame);
|
||||
|
||||
private:
|
||||
std::unique_ptr<extensions::Dispatcher> dispatcher_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionsRendererClient);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_EXTENSIONS_ELECTRON_EXTENSIONS_RENDERER_CLIENT_H_
|
Loading…
Add table
Add a link
Reference in a new issue