cef/libcef/browser_request_context.cc
Marshall Greenblatt 73027bb5a9 libcef: Update due to underlying chromium changes.
- External plugin loading support is now provided by webkit/glue/plugins so the libcef/plugins directory has been eliminated, with related changes.
- Modify the CefPluginInfo structure to use a more friendly data organization format.
- Remove CefUnregisterPlugin() as it is no longer functional.
- WebViewDelegate::ShowContextMenu() now receives the menu type as a bit-masked flag, so adjust the API accordingly.
- WebViewDelegate::GetContainingView() now returns a gfx::NativeViewId instead of a gfx::NativeView.
- Modify BrowserRequestContext because GetUserAgent() is now a virtual method of URLRequestContext.
- The data buffer in RequestProxy is now a net::IOBuffer.
- Add webkit_glue::GetScreenInfo().

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@10 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2009-01-29 16:36:37 +00:00

58 lines
1.6 KiB
C++

// Copyright (c) 2008 The Chromium Embedded Framework Authors.
// Portions copyright (c) 2006-2008 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.
#include "precompiled_libcef.h"
#include "browser_request_context.h"
#include "net/base/cookie_monster.h"
#include "net/proxy/proxy_service.h"
#include "webkit/glue/webkit_glue.h"
BrowserRequestContext::BrowserRequestContext() {
Init(std::wstring(), net::HttpCache::NORMAL, false);
}
BrowserRequestContext::BrowserRequestContext(
const std::wstring& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy) {
Init(cache_path, cache_mode, no_proxy);
}
void BrowserRequestContext::Init(
const std::wstring& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy) {
cookie_store_ = new net::CookieMonster();
// hard-code A-L and A-C for test shells
accept_language_ = "en-us,en";
accept_charset_ = "iso-8859-1,*,utf-8";
net::ProxyInfo proxy_info;
proxy_info.UseDirect();
proxy_service_ = net::ProxyService::Create(no_proxy ? &proxy_info : NULL);
net::HttpCache *cache;
if (cache_path.empty()) {
cache = new net::HttpCache(proxy_service_, 0);
} else {
cache = new net::HttpCache(proxy_service_, cache_path, 0);
}
cache->set_mode(cache_mode);
http_transaction_factory_ = cache;
}
BrowserRequestContext::~BrowserRequestContext() {
delete cookie_store_;
delete http_transaction_factory_;
delete proxy_service_;
}
const std::string& BrowserRequestContext::GetUserAgent(
const GURL& url) const {
return webkit_glue::GetUserAgent(url);
}