2019-07-24 23:01:08 +00:00
|
|
|
// Copyright (c) 2017 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
#ifndef SHELL_RENDERER_EXTENSIONS_ELECTRON_EXTENSIONS_RENDERER_CLIENT_H_
|
|
|
|
#define SHELL_RENDERER_EXTENSIONS_ELECTRON_EXTENSIONS_RENDERER_CLIENT_H_
|
2019-07-24 23:01:08 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "base/macros.h"
|
|
|
|
#include "extensions/renderer/extensions_renderer_client.h"
|
|
|
|
|
|
|
|
namespace content {
|
|
|
|
class RenderFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace extensions {
|
|
|
|
class Dispatcher;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace electron {
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
class ElectronExtensionsRendererClient
|
2019-07-24 23:01:08 +00:00
|
|
|
: public extensions::ExtensionsRendererClient {
|
|
|
|
public:
|
2020-02-03 22:01:10 +00:00
|
|
|
ElectronExtensionsRendererClient();
|
|
|
|
~ElectronExtensionsRendererClient() override;
|
2019-07-24 23:01:08 +00:00
|
|
|
|
|
|
|
// 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_;
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionsRendererClient);
|
2019-07-24 23:01:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace electron
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
#endif // SHELL_RENDERER_EXTENSIONS_ELECTRON_EXTENSIONS_RENDERER_CLIENT_H_
|