2013-01-03 18:24:24 +01:00
|
|
|
// Copyright (c) 2013 The Chromium Embedded Framework Authors.
|
2012-04-03 03:34:16 +02:00
|
|
|
// Portions copyright (c) 2011 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.
|
|
|
|
|
2016-05-25 01:35:43 +02:00
|
|
|
#ifndef CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_
|
|
|
|
#define CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-10-21 21:52:29 +02:00
|
|
|
#include <memory>
|
|
|
|
|
2012-12-31 11:41:15 +01:00
|
|
|
#include "base/compiler_specific.h"
|
2019-09-25 15:59:51 +02:00
|
|
|
#include "chrome/common/renderer_configuration.mojom.h"
|
|
|
|
#include "components/content_settings/core/common/content_settings.h"
|
2016-05-25 01:35:43 +02:00
|
|
|
#include "content/public/renderer/render_thread_observer.h"
|
2019-09-25 15:59:51 +02:00
|
|
|
#include "mojo/public/cpp/bindings/associated_binding_set.h"
|
2019-11-12 17:11:44 +01:00
|
|
|
#include "mojo/public/cpp/bindings/associated_receiver_set.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2012-11-20 21:08:36 +01:00
|
|
|
struct Cef_CrossOriginWhiteListEntry_Params;
|
|
|
|
|
2019-09-25 15:59:51 +02:00
|
|
|
// This class sends and receives control messages in the renderer process.
|
|
|
|
class CefRenderThreadObserver : public content::RenderThreadObserver,
|
|
|
|
public chrome::mojom::RendererConfiguration {
|
2012-04-03 03:34:16 +02:00
|
|
|
public:
|
2016-05-25 01:35:43 +02:00
|
|
|
CefRenderThreadObserver();
|
|
|
|
~CefRenderThreadObserver() override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
static bool is_incognito_process() { return is_incognito_process_; }
|
|
|
|
|
2019-09-25 15:59:51 +02:00
|
|
|
// Return the dynamic parameters - those that may change while the
|
|
|
|
// render process is running.
|
|
|
|
static const chrome::mojom::DynamicParams& GetDynamicParams();
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
private:
|
2019-09-25 15:59:51 +02:00
|
|
|
// content::RenderThreadObserver:
|
|
|
|
bool OnControlMessageReceived(const IPC::Message& message) override;
|
|
|
|
void RegisterMojoInterfaces(
|
|
|
|
blink::AssociatedInterfaceRegistry* associated_interfaces) override;
|
|
|
|
void UnregisterMojoInterfaces(
|
|
|
|
blink::AssociatedInterfaceRegistry* associated_interfaces) override;
|
|
|
|
|
|
|
|
// chrome::mojom::RendererConfiguration:
|
2019-11-12 17:11:44 +01:00
|
|
|
void SetInitialConfiguration(
|
|
|
|
bool is_incognito_process,
|
|
|
|
mojo::PendingReceiver<chrome::mojom::ChromeOSListener> chromeos_listener)
|
|
|
|
override;
|
2019-09-25 15:59:51 +02:00
|
|
|
void SetConfiguration(chrome::mojom::DynamicParamsPtr params) override;
|
|
|
|
void SetContentSettingRules(
|
|
|
|
const RendererContentSettingRules& rules) override;
|
|
|
|
|
|
|
|
void OnRendererConfigurationAssociatedRequest(
|
2019-11-12 17:11:44 +01:00
|
|
|
mojo::PendingAssociatedReceiver<chrome::mojom::RendererConfiguration>
|
|
|
|
receiver);
|
2019-09-25 15:59:51 +02:00
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Message handlers called on the render thread.
|
2012-11-20 21:08:36 +01:00
|
|
|
void OnModifyCrossOriginWhitelistEntry(
|
|
|
|
bool add,
|
|
|
|
const Cef_CrossOriginWhiteListEntry_Params& params);
|
2012-04-03 03:34:16 +02:00
|
|
|
void OnClearCrossOriginWhitelist();
|
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
static bool is_incognito_process_;
|
|
|
|
|
2019-11-12 17:11:44 +01:00
|
|
|
mojo::AssociatedReceiverSet<chrome::mojom::RendererConfiguration>
|
|
|
|
renderer_configuration_receivers_;
|
2019-09-25 15:59:51 +02:00
|
|
|
|
2016-05-25 01:35:43 +02:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefRenderThreadObserver);
|
2012-04-03 03:34:16 +02:00
|
|
|
};
|
|
|
|
|
2016-05-25 01:35:43 +02:00
|
|
|
#endif // CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_
|