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"
|
2016-05-25 01:35:43 +02:00
|
|
|
#include "content/public/renderer/render_thread_observer.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-10-21 21:52:29 +02:00
|
|
|
namespace visitedlink {
|
|
|
|
class VisitedLinkSlave;
|
|
|
|
}
|
|
|
|
|
2012-11-20 21:08:36 +01:00
|
|
|
struct Cef_CrossOriginWhiteListEntry_Params;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// This class sends and receives control messages on the renderer process.
|
2016-05-25 01:35:43 +02:00
|
|
|
class CefRenderThreadObserver : public content::RenderThreadObserver {
|
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_; }
|
|
|
|
|
2016-05-25 01:35:43 +02:00
|
|
|
// RenderThreadObserver implementation.
|
2014-11-12 20:25:15 +01:00
|
|
|
bool OnControlMessageReceived(const IPC::Message& message) override;
|
|
|
|
void OnRenderProcessShutdown() override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-10-21 21:52:29 +02:00
|
|
|
visitedlink::VisitedLinkSlave* visited_link_slave() {
|
|
|
|
return visited_link_slave_.get();
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
private:
|
|
|
|
// Message handlers called on the render thread.
|
2015-07-16 23:40:01 +02:00
|
|
|
void OnSetIsIncognitoProcess(bool is_incognito_process);
|
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_;
|
|
|
|
|
2016-10-21 21:52:29 +02:00
|
|
|
std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_;
|
|
|
|
|
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_
|