2015-07-16 23:40:01 +02:00
|
|
|
// 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_RENDERER_EXTENSIONS_EXTENSIONS_RENDERER_CLIENT_H_
|
|
|
|
#define CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_RENDERER_CLIENT_H_
|
|
|
|
|
2016-05-25 01:35:43 +02:00
|
|
|
#include <memory>
|
2015-11-10 21:18:16 +01:00
|
|
|
#include <string>
|
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
#include "base/macros.h"
|
|
|
|
#include "extensions/renderer/extensions_renderer_client.h"
|
2017-09-06 23:40:58 +02:00
|
|
|
#include "services/service_manager/public/cpp/binder_registry.h"
|
2015-11-10 21:18:16 +01:00
|
|
|
#include "ui/base/page_transition_types.h"
|
|
|
|
|
|
|
|
class GURL;
|
|
|
|
|
|
|
|
namespace blink {
|
|
|
|
class WebFrame;
|
|
|
|
class WebLocalFrame;
|
|
|
|
struct WebPluginParams;
|
2016-11-23 21:54:29 +01:00
|
|
|
class WebURL;
|
2017-07-27 01:19:27 +02:00
|
|
|
} // namespace blink
|
2015-11-10 21:18:16 +01:00
|
|
|
|
|
|
|
namespace content {
|
|
|
|
class BrowserPluginDelegate;
|
|
|
|
class RenderFrame;
|
2017-07-27 01:19:27 +02:00
|
|
|
} // namespace content
|
2015-07-16 23:40:01 +02:00
|
|
|
|
|
|
|
namespace extensions {
|
|
|
|
|
2015-11-10 21:18:16 +01:00
|
|
|
class Dispatcher;
|
|
|
|
class DispatcherDelegate;
|
|
|
|
class ExtensionsGuestViewContainerDispatcher;
|
|
|
|
class ResourceRequestPolicy;
|
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
class CefExtensionsRendererClient : public ExtensionsRendererClient {
|
|
|
|
public:
|
|
|
|
CefExtensionsRendererClient();
|
|
|
|
~CefExtensionsRendererClient() override;
|
|
|
|
|
|
|
|
// ExtensionsRendererClient implementation.
|
|
|
|
bool IsIncognitoProcess() const override;
|
|
|
|
int GetLowestIsolatedWorldId() const override;
|
2017-07-27 01:19:27 +02:00
|
|
|
extensions::Dispatcher* GetDispatcher() override;
|
|
|
|
void OnExtensionLoaded(const extensions::Extension& extension) override;
|
|
|
|
void OnExtensionUnloaded(
|
|
|
|
const extensions::ExtensionId& extension_id) override;
|
2015-07-16 23:40:01 +02:00
|
|
|
|
2015-11-10 21:18:16 +01:00
|
|
|
// See CefContentRendererClient methods with the same names.
|
|
|
|
void RenderThreadStarted();
|
2017-09-06 23:40:58 +02:00
|
|
|
void RenderFrameCreated(content::RenderFrame* render_frame,
|
|
|
|
service_manager::BinderRegistry* registry);
|
2015-11-10 21:18:16 +01:00
|
|
|
bool OverrideCreatePlugin(content::RenderFrame* render_frame,
|
|
|
|
const blink::WebPluginParams& params);
|
2017-01-23 18:36:54 +01:00
|
|
|
bool WillSendRequest(blink::WebLocalFrame* frame,
|
2015-11-10 21:18:16 +01:00
|
|
|
ui::PageTransition transition_type,
|
2016-11-23 21:54:29 +01:00
|
|
|
const blink::WebURL& url,
|
2015-11-10 21:18:16 +01:00
|
|
|
GURL* new_url);
|
2016-04-27 22:38:52 +02:00
|
|
|
void RunScriptsAtDocumentStart(content::RenderFrame* render_frame);
|
|
|
|
void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame);
|
2017-04-20 21:28:17 +02:00
|
|
|
void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame);
|
2015-11-10 21:18:16 +01:00
|
|
|
|
2017-09-06 23:40:58 +02:00
|
|
|
static bool IsStandaloneExtensionProcess();
|
2015-11-10 21:18:16 +01:00
|
|
|
static bool ShouldFork(blink::WebLocalFrame* frame,
|
|
|
|
const GURL& url,
|
|
|
|
bool is_initial_navigation,
|
|
|
|
bool is_server_redirect,
|
|
|
|
bool* send_referrer);
|
|
|
|
static content::BrowserPluginDelegate* CreateBrowserPluginDelegate(
|
|
|
|
content::RenderFrame* render_frame,
|
|
|
|
const std::string& mime_type,
|
|
|
|
const GURL& original_url);
|
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
private:
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<extensions::Dispatcher> extension_dispatcher_;
|
|
|
|
std::unique_ptr<extensions::ExtensionsGuestViewContainerDispatcher>
|
2015-11-10 21:18:16 +01:00
|
|
|
guest_view_container_dispatcher_;
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<extensions::ResourceRequestPolicy> resource_request_policy_;
|
2015-11-10 21:18:16 +01:00
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefExtensionsRendererClient);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace extensions
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_RENDERER_CLIENT_H_
|