2013-09-03 18:43:31 +02:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "libcef/browser/browser_context.h"
|
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
#include "libcef/browser/url_request_context_getter_impl.h"
|
|
|
|
|
2013-09-03 18:43:31 +02:00
|
|
|
#include "base/files/file_path.h"
|
|
|
|
#include "base/memory/ref_counted.h"
|
|
|
|
#include "base/memory/scoped_ptr.h"
|
|
|
|
|
|
|
|
namespace content {
|
|
|
|
class DownloadManagerDelegate;
|
|
|
|
class SpeechRecognitionPreferences;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CefDownloadManagerDelegate;
|
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
// Global BrowserContext implementation. Life span is controlled by
|
|
|
|
// CefRequestContextImpl and CefBrowserMainParts. Only accessed on the UI
|
|
|
|
// thread. See browser_context.h for an object relationship diagram.
|
2013-09-03 18:43:31 +02:00
|
|
|
class CefBrowserContextImpl : public CefBrowserContext {
|
|
|
|
public:
|
|
|
|
CefBrowserContextImpl();
|
|
|
|
|
|
|
|
// BrowserContext methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
base::FilePath GetPath() const override;
|
2014-12-13 21:18:31 +01:00
|
|
|
scoped_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
|
|
|
|
const base::FilePath& partition_path) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
bool IsOffTheRecord() const override;
|
|
|
|
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
|
|
|
|
net::URLRequestContextGetter* GetRequestContext() override;
|
|
|
|
net::URLRequestContextGetter* GetRequestContextForRenderProcess(
|
|
|
|
int renderer_child_id) override;
|
|
|
|
net::URLRequestContextGetter* GetMediaRequestContext() override;
|
|
|
|
net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
|
|
|
|
int renderer_child_id) override;
|
|
|
|
net::URLRequestContextGetter*
|
2013-09-03 18:43:31 +02:00
|
|
|
GetMediaRequestContextForStoragePartition(
|
|
|
|
const base::FilePath& partition_path,
|
2014-11-12 20:25:15 +01:00
|
|
|
bool in_memory) override;
|
|
|
|
content::BrowserPluginGuestManager* GetGuestManager() override;
|
|
|
|
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
|
|
|
|
content::PushMessagingService* GetPushMessagingService() override;
|
|
|
|
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
|
2013-09-03 18:43:31 +02:00
|
|
|
|
|
|
|
// CefBrowserContext methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
net::URLRequestContextGetter* CreateRequestContext(
|
2014-04-04 18:50:38 +02:00
|
|
|
content::ProtocolHandlerMap* protocol_handlers,
|
2014-06-12 22:28:58 +02:00
|
|
|
content::URLRequestInterceptorScopedVector request_interceptors)
|
2014-11-12 20:25:15 +01:00
|
|
|
override;
|
|
|
|
net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
|
2013-09-03 18:43:31 +02:00
|
|
|
const base::FilePath& partition_path,
|
|
|
|
bool in_memory,
|
2014-04-04 18:50:38 +02:00
|
|
|
content::ProtocolHandlerMap* protocol_handlers,
|
2014-06-12 22:28:58 +02:00
|
|
|
content::URLRequestInterceptorScopedVector request_interceptors)
|
2014-11-12 20:25:15 +01:00
|
|
|
override;
|
2013-09-03 18:43:31 +02:00
|
|
|
|
|
|
|
private:
|
2015-02-14 00:17:08 +01:00
|
|
|
// Only allow deletion via scoped_refptr().
|
|
|
|
friend struct content::BrowserThread::DeleteOnThread<
|
|
|
|
content::BrowserThread::UI>;
|
|
|
|
friend class base::DeleteHelper<CefBrowserContextImpl>;
|
|
|
|
|
|
|
|
~CefBrowserContextImpl() override;
|
2013-09-03 18:43:31 +02:00
|
|
|
|
|
|
|
scoped_ptr<CefDownloadManagerDelegate> download_manager_delegate_;
|
2015-02-14 00:17:08 +01:00
|
|
|
scoped_refptr<CefURLRequestContextGetterImpl> url_request_getter_;
|
2013-09-03 18:43:31 +02:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefBrowserContextImpl);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_
|