libcef: Modifications due to underlying chromium changes.

- Change gfx::WindowHandle to gfx::NativeWindow and gfx::ViewHandle to gfx::NativeView.
- Add proxy support to BrowserWebViewDelegate.
- Add webkit\port\platform\graphics\skia path to libcef_webkit_includes.vsprops due to relocation of PlatformContextSkia.h.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@4 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2008-12-13 18:42:19 +00:00
parent 166b8524dd
commit d0639c9f4e
12 changed files with 125 additions and 114 deletions

View File

@ -9,3 +9,4 @@ Date | CEF Revision | Chromium Revision
-------------------------------------------------------------------------------
2008-12-02 | /trunk@2 | /trunk@6213
2008-12-05 | /trunk@3 | /trunk@6430
2008-12-13 | /trunk@4 | /trunk@6968

View File

@ -7,21 +7,24 @@
#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);
Init(std::wstring(), net::HttpCache::NORMAL, false);
}
BrowserRequestContext::BrowserRequestContext(
const std::wstring& cache_path,
net::HttpCache::Mode cache_mode) {
Init(cache_path, cache_mode);
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) {
net::HttpCache::Mode cache_mode,
bool no_proxy) {
cookie_store_ = new net::CookieMonster();
user_agent_ = webkit_glue::GetUserAgent();
@ -30,11 +33,15 @@ void BrowserRequestContext::Init(
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(NULL, 0);
cache = new net::HttpCache(proxy_service_, 0);
} else {
cache = new net::HttpCache(NULL, cache_path, 0);
cache = new net::HttpCache(proxy_service_, cache_path, 0);
}
cache->set_mode(cache_mode);
http_transaction_factory_ = cache;
@ -43,5 +50,6 @@ void BrowserRequestContext::Init(
BrowserRequestContext::~BrowserRequestContext() {
delete cookie_store_;
delete http_transaction_factory_;
delete proxy_service_;
}

View File

@ -18,12 +18,14 @@ class BrowserRequestContext : public URLRequestContext {
// Use an on-disk cache at the specified location. Optionally, use the cache
// in playback or record mode.
BrowserRequestContext(const std::wstring& cache_path,
net::HttpCache::Mode cache_mode);
net::HttpCache::Mode cache_mode,
bool no_proxy);
~BrowserRequestContext();
private:
void Init(const std::wstring& cache_path, net::HttpCache::Mode cache_mode);
void Init(const std::wstring& cache_path, net::HttpCache::Mode cache_mode,
bool no_proxy);
};
#endif // _BROWSER_REQUEST_CONTEXT_H

View File

@ -56,7 +56,7 @@ bool DownloadUrl(const std::string& url, HWND caller_window) {
return false;
}
ScreenInfo GetScreenInfo(gfx::ViewHandle window) {
ScreenInfo GetScreenInfo(gfx::NativeView window) {
return GetScreenInfoHelper(window);
}

View File

@ -468,7 +468,7 @@ void BrowserWebViewDelegate::SetUserStyleSheetLocation(const GURL& location) {
// WebWidgetDelegate ---------------------------------------------------------
gfx::ViewHandle BrowserWebViewDelegate::GetContainingWindow(WebWidget* webwidget) {
gfx::NativeView BrowserWebViewDelegate::GetContainingWindow(WebWidget* webwidget) {
if (WebWidgetHost* host = GetHostForWidget(webwidget))
return host->window_handle();

View File

@ -179,7 +179,7 @@ class BrowserWebViewDelegate : public base::RefCounted<BrowserWebViewDelegate>,
virtual int GetHistoryForwardListCount();
// WebWidgetDelegate
virtual gfx::ViewHandle GetContainingWindow(WebWidget* webwidget);
virtual gfx::NativeView GetContainingWindow(WebWidget* webwidget);
virtual void DidInvalidateRect(WebWidget* webwidget, const gfx::Rect& rect);
virtual void DidScrollRect(WebWidget* webwidget, int dx, int dy,
const gfx::Rect& clip_rect);

View File

@ -98,7 +98,7 @@ DWORD WINAPI ThreadHandlerUI(LPVOID lpParam)
std::wstring cache_path;
PathService::Get(base::DIR_EXE, &cache_path);
BrowserResourceLoaderBridge::Init(
new BrowserRequestContext(cache_path, net::HttpCache::NORMAL));
new BrowserRequestContext(cache_path, net::HttpCache::NORMAL, false));
// Load ICU data tables.
bool ret = icu_util::Initialize();

View File

@ -6,6 +6,6 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(OutDir)\obj\WebCore&quot;;&quot;$(OutDir)\obj\WebCore\JavaScriptHeaders&quot;;&quot;$(OutDir)\obj\WebCore\JavaScriptHeaders\JavaScriptCore&quot;;&quot;$(SolutionDir)..\webkit\pending\&quot;;&quot;$(SolutionDir)..\webkit\pending\kjs&quot;;&quot;$(SolutionDir)..\webkit\pending\wtf&quot;;&quot;$(SolutionDir)..\webkit\port\bridge&quot;;&quot;$(SolutionDir)..\webkit\port\css&quot;;&quot;$(SolutionDir)..\webkit\port\dom&quot;;&quot;$(SolutionDir)..\webkit\port\history&quot;;&quot;$(SolutionDir)..\webkit\port\loader&quot;;&quot;$(SolutionDir)..\webkit\port\page&quot;;&quot;$(SolutionDir)..\webkit\port\page\chromium&quot;;&quot;$(SolutionDir)..\webkit\port\page\win&quot;;&quot;$(SolutionDir)..\webkit\port\platform&quot;;&quot;$(SolutionDir)..\webkit\port\platform\chromium&quot;;&quot;$(SolutionDir)..\webkit\port\platform\win&quot;;&quot;$(SolutionDir)..\webkit\port\platform\network\chromium&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\bmp&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\gif&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\ico&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\jpeg&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\png&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\xbm&quot;;&quot;$(SolutionDir)..\webkit\port\platform\network&quot;;&quot;$(SolutionDir)..\webkit\port\plugins&quot;;&quot;$(SolutionDir)..\webkit\port\rendering&quot;;&quot;$(SolutionDir)..\webkit\port\platform\graphics&quot;;&quot;$(SolutionDir)..\webkit\port\platform\graphics\chromium&quot;;&quot;$(SolutionDir)..\webkit&quot;;&quot;$(SolutionDir)..\webkit\build&quot;;&quot;$(ProjectDir)&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\bridge&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\bridge\c&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\css&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\dom&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\editing&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\history&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\html&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\appcache&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\archive&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\icon&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\page&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\page\animation&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\text&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\network&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\sql&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\rendering&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\rendering\style&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\storage&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\xml&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\os-win32&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\wtf&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore\wtf&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore\os-win32&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\animation&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics\filters&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\plugins&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\inspector&quot;;&quot;$(SolutionDir)..\third_party\sqlite&quot;;&quot;$(SDKIncludes)&quot;;&quot;$(IntDir)\..\WebCore\DerivedSources&quot;;"
AdditionalIncludeDirectories="&quot;$(OutDir)\obj\WebCore&quot;;&quot;$(OutDir)\obj\WebCore\JavaScriptHeaders&quot;;&quot;$(OutDir)\obj\WebCore\JavaScriptHeaders\JavaScriptCore&quot;;&quot;$(SolutionDir)..\webkit\pending\&quot;;&quot;$(SolutionDir)..\webkit\pending\kjs&quot;;&quot;$(SolutionDir)..\webkit\pending\wtf&quot;;&quot;$(SolutionDir)..\webkit\port\bridge&quot;;&quot;$(SolutionDir)..\webkit\port\css&quot;;&quot;$(SolutionDir)..\webkit\port\dom&quot;;&quot;$(SolutionDir)..\webkit\port\history&quot;;&quot;$(SolutionDir)..\webkit\port\loader&quot;;&quot;$(SolutionDir)..\webkit\port\page&quot;;&quot;$(SolutionDir)..\webkit\port\page\chromium&quot;;&quot;$(SolutionDir)..\webkit\port\page\win&quot;;&quot;$(SolutionDir)..\webkit\port\platform&quot;;&quot;$(SolutionDir)..\webkit\port\platform\chromium&quot;;&quot;$(SolutionDir)..\webkit\port\platform\win&quot;;&quot;$(SolutionDir)..\webkit\port\platform\network\chromium&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\bmp&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\gif&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\ico&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\jpeg&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\png&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\xbm&quot;;&quot;$(SolutionDir)..\webkit\port\platform\network&quot;;&quot;$(SolutionDir)..\webkit\port\plugins&quot;;&quot;$(SolutionDir)..\webkit\port\rendering&quot;;&quot;$(SolutionDir)..\webkit\port\platform\graphics&quot;;&quot;$(SolutionDir)..\webkit\port\platform\graphics\chromium&quot;;&quot;$(SolutionDir)..\webkit\port\platform\graphics\skia&quot;;&quot;$(SolutionDir)..\webkit&quot;;&quot;$(SolutionDir)..\webkit\build&quot;;&quot;$(ProjectDir)&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\bridge&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\bridge\c&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\css&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\dom&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\editing&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\history&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\html&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\appcache&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\archive&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\icon&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\page&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\page\animation&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\text&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\network&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\sql&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\rendering&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\rendering\style&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\storage&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\xml&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\os-win32&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\wtf&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore\wtf&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore\os-win32&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\animation&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics\filters&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\plugins&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\inspector&quot;;&quot;$(SolutionDir)..\third_party\sqlite&quot;;&quot;$(SDKIncludes)&quot;;&quot;$(IntDir)\..\WebCore\DerivedSources&quot;;"
/>
</VisualStudioPropertySheet>

View File

@ -15,7 +15,7 @@
static const wchar_t kWindowClassName[] = L"WebViewHost";
/*static*/
WebViewHost* WebViewHost::Create(gfx::WindowHandle parent_window,
WebViewHost* WebViewHost::Create(gfx::NativeWindow parent_window,
WebViewDelegate* delegate,
const WebPreferences& prefs) {
WebViewHost* host = new WebViewHost();

View File

@ -21,7 +21,7 @@ class WebViewHost : public WebWidgetHost {
// The new instance is deleted once the associated ViewHandle is destroyed.
// The newly created window should be resized after it is created, using the
// MoveWindow (or equivalent) function.
static WebViewHost* Create(gfx::WindowHandle parent_window,
static WebViewHost* Create(gfx::NativeWindow parent_window,
WebViewDelegate* delegate,
const WebPreferences& prefs);

View File

@ -15,7 +15,7 @@
static const wchar_t kWindowClassName[] = L"WebWidgetHost";
/*static*/
WebWidgetHost* WebWidgetHost::Create(gfx::WindowHandle parent_window,
WebWidgetHost* WebWidgetHost::Create(gfx::NativeWindow parent_window,
WebWidgetDelegate* delegate) {
WebWidgetHost* host = new WebWidgetHost();
@ -45,7 +45,7 @@ WebWidgetHost* WebWidgetHost::Create(gfx::WindowHandle parent_window,
}
/*static*/
WebWidgetHost* WebWidgetHost::FromWindow(gfx::WindowHandle hwnd) {
WebWidgetHost* WebWidgetHost::FromWindow(gfx::NativeWindow hwnd) {
return reinterpret_cast<WebWidgetHost*>(win_util::GetWindowUserData(hwnd));
}

View File

@ -24,15 +24,15 @@ class WebWidgetHost {
// The new instance is deleted once the associated ViewHandle is destroyed.
// The newly created window should be resized after it is created, using the
// MoveWindow (or equivalent) function.
static WebWidgetHost* Create(gfx::WindowHandle parent_window,
static WebWidgetHost* Create(gfx::NativeWindow parent_window,
WebWidgetDelegate* delegate);
static WebWidgetHost* FromWindow(gfx::WindowHandle view);
static WebWidgetHost* FromWindow(gfx::NativeWindow view);
#if defined(OS_MACOSX)
static void HandleEvent(gfx::WindowHandle window, NSEvent *event);
static void HandleEvent(gfx::NativeWindow window, NSEvent *event);
#endif
gfx::ViewHandle window_handle() const { return view_; }
gfx::NativeView window_handle() const { return view_; }
WebWidget* webwidget() const { return webwidget_; }
void DidInvalidateRect(const gfx::Rect& rect);
@ -83,7 +83,7 @@ class WebWidgetHost {
// parent: a GtkBox to pack the new widget at the end of
// host: a pointer to a WebWidgetHost (or subclass thereof)
// ---------------------------------------------------------------------------
static gfx::WindowHandle CreateWindow(gfx::WindowHandle parent, void* host);
static gfx::NativeWindow CreateWindow(gfx::NativeWindow parent, void* host);
void WindowDestroyed();
void Resize(const gfx::Size& size);
#endif
@ -98,7 +98,7 @@ class WebWidgetHost {
#endif
}
gfx::ViewHandle view_;
gfx::NativeView view_;
WebWidget* webwidget_;
scoped_ptr<gfx::PlatformCanvas> canvas_;