libcef: Update due to underlying chromium changes.

- Add simple_clipboard_impl.cc to the libcef project because it is no longer included as part of the webkit/glue project.
- Add the FindProxyForUrl() function to browser_resource_loader_bridge.cc.
- NPAPI function pointers are now stored in a structure member of NPAPI::PluginVersionInfo.
- Change gfx::NativeWindow to gfx::NativeView in webview_host and webview_host.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@14 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2009-02-04 22:17:38 +00:00
parent 15f6c270fa
commit 577b8387cf
8 changed files with 66 additions and 15 deletions

View File

@@ -46,6 +46,7 @@
#include "net/base/io_buffer.h"
#include "net/base/net_util.h"
#include "net/base/upload_data.h"
#include "net/proxy/proxy_service.h"
#include "net/url_request/url_request.h"
#include "webkit/glue/resource_loader_bridge.h"
#include "webkit/glue/webframe.h"
@@ -628,6 +629,24 @@ std::string GetCookies(const GURL& url, const GURL& policy_url) {
return getter->GetResult();
}
// Issue the proxy resolve request on the io thread, and wait
// for the result.
bool FindProxyForUrl(const GURL& url, std::string* proxy_list) {
DCHECK(request_context);
scoped_refptr<net::SyncProxyServiceHelper> sync_proxy_service(
new net::SyncProxyServiceHelper(io_thread->message_loop(),
request_context->proxy_service()));
net::ProxyInfo proxy_info;
int rv = sync_proxy_service->ResolveProxy(url, &proxy_info);
if (rv == net::OK) {
*proxy_list = proxy_info.GetAnnotatedProxyList();
}
return rv == net::OK;
}
} // namespace webkit_glue
//-----------------------------------------------------------------------------

View File

@@ -130,9 +130,9 @@ void CefContext::UIT_RegisterPlugin(struct CefPluginInfo* plugin_info)
}
}
info.np_getentrypoints = plugin_info->np_getentrypoints;
info.np_initialize = plugin_info->np_initialize;
info.np_shutdown = plugin_info->np_shutdown;
info.entry_points.np_getentrypoints = plugin_info->np_getentrypoints;
info.entry_points.np_initialize = plugin_info->np_initialize;
info.entry_points.np_shutdown = plugin_info->np_shutdown;
NPAPI::PluginList::RegisterInternalPlugin(info);
NPAPI::PluginList::Singleton()->LoadPlugin(FilePath(info.path));

View File

@@ -197,6 +197,30 @@
>
</File>
</Filter>
<Filter
Name="external_files"
>
<File
RelativePath="..\..\webkit\glue\simple_clipboard_impl.cc"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
</Filter>
<File
RelativePath=".\browser_drag_delegate.cc"
>

View File

@@ -15,7 +15,7 @@
static const wchar_t kWindowClassName[] = L"WebViewHost";
/*static*/
WebViewHost* WebViewHost::Create(gfx::NativeWindow parent_window,
WebViewHost* WebViewHost::Create(HWND parent_view,
WebViewDelegate* delegate,
const WebPreferences& prefs) {
WebViewHost* host = new WebViewHost();
@@ -35,7 +35,7 @@ WebViewHost* WebViewHost::Create(gfx::NativeWindow parent_window,
host->view_ = CreateWindow(kWindowClassName, NULL,
WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, 0, 0,
0, 0, parent_window, NULL,
0, 0, parent_view, NULL,
GetModuleHandle(NULL), NULL);
win_util::SetWindowUserData(host->view_, host);

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::NativeWindow parent_window,
static WebViewHost* Create(gfx::NativeView 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::NativeWindow parent_window,
WebWidgetHost* WebWidgetHost::Create(HWND parent_view,
WebWidgetDelegate* delegate) {
WebWidgetHost* host = new WebWidgetHost();
@@ -35,8 +35,9 @@ WebWidgetHost* WebWidgetHost::Create(gfx::NativeWindow parent_window,
host->view_ = CreateWindowEx(WS_EX_TOOLWINDOW,
kWindowClassName, kWindowClassName, WS_POPUP,
0, 0, 0, 0,
parent_window, NULL, GetModuleHandle(NULL), NULL);
parent_view, NULL, GetModuleHandle(NULL), NULL);
TRACK_HWND_CREATION(host->view_);
win_util::SetWindowUserData(host->view_, host);
host->webwidget_ = WebWidget::Create(delegate);
@@ -45,8 +46,8 @@ WebWidgetHost* WebWidgetHost::Create(gfx::NativeWindow parent_window,
}
/*static*/
WebWidgetHost* WebWidgetHost::FromWindow(gfx::NativeWindow hwnd) {
return reinterpret_cast<WebWidgetHost*>(win_util::GetWindowUserData(hwnd));
WebWidgetHost* WebWidgetHost::FromWindow(HWND view) {
return reinterpret_cast<WebWidgetHost*>(win_util::GetWindowUserData(view));
}
/*static*/
@@ -58,6 +59,9 @@ LRESULT CALLBACK WebWidgetHost::WndProc(HWND hwnd, UINT message, WPARAM wparam,
case WM_DESTROY:
delete host;
break;
case WM_NCDESTROY:
TRACK_HWND_DESTRUCTION(hwnd);
break;
case WM_PAINT: {
RECT rect;

View File

@@ -24,12 +24,12 @@ 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::NativeWindow parent_window,
static WebWidgetHost* Create(gfx::NativeView parent_view,
WebWidgetDelegate* delegate);
static WebWidgetHost* FromWindow(gfx::NativeWindow view);
static WebWidgetHost* FromWindow(gfx::NativeView view);
#if defined(OS_MACOSX)
static void HandleEvent(gfx::NativeWindow window, NSEvent *event);
static void HandleEvent(gfx::NativeView view, NSEvent *event);
#endif
gfx::NativeView window_handle() const { return view_; }
@@ -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::NativeWindow CreateWindow(gfx::NativeWindow parent, void* host);
static gfx::NativeView CreateWindow(gfx::NativeView parent_view, void* host);
void WindowDestroyed();
void Resize(const gfx::Size& size);
#endif