mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add initial WebUI support (issue #2037)
- Visit chrome://webui-hosts for the list of supported hosts.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
|
||||
#include "content/browser/resource_context_impl.h"
|
||||
#include "content/browser/streams/stream_context.h"
|
||||
#include "content/browser/webui/url_data_manager.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
|
||||
namespace {
|
||||
@@ -47,6 +48,10 @@ bool ShouldProxyUserData(const void* key) {
|
||||
if (key == kFontFamilyCacheKey)
|
||||
return true;
|
||||
|
||||
// If this value is not proxied WebUI will fail to load.
|
||||
if (key == content::URLDataManager::GetUserDataKey())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -69,6 +74,14 @@ CefBrowserContextProxy::~CefBrowserContextProxy() {
|
||||
parent_->RemoveProxy(this);
|
||||
}
|
||||
|
||||
void CefBrowserContextProxy::Initialize() {
|
||||
CefBrowserContext::Initialize();
|
||||
|
||||
// This object's CefResourceContext needs to proxy some UserData requests to
|
||||
// the parent object's CefResourceContext.
|
||||
resource_context()->set_parent(parent_->resource_context());
|
||||
}
|
||||
|
||||
base::SupportsUserData::Data*
|
||||
CefBrowserContextProxy::GetUserData(const void* key) const {
|
||||
if (ShouldProxyUserData(key))
|
||||
|
Reference in New Issue
Block a user