diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 3118be4e8..c99c1b158 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -43,3 +43,4 @@ Date | CEF Revision | Chromium Revision 2009-10-02 | /trunk@51 | /trunk@27900 2009-10-12 | /trunk@53 | /trunk@28713 2009-10-18 | /trunk@58 | /trunk@29378 +2009-10-21 | /trunk@60 | /trunk@29687 diff --git a/cef.gyp b/cef.gyp index 3dbc80948..6052c1034 100644 --- a/cef.gyp +++ b/cef.gyp @@ -344,6 +344,8 @@ 'libcef/browser_request_context.h', 'libcef/browser_resource_loader_bridge.cc', 'libcef/browser_resource_loader_bridge.h', + 'libcef/browser_socket_stream_bridge.cc', + 'libcef/browser_socket_stream_bridge.h', 'libcef/browser_webkit_glue.cc', 'libcef/browser_webkit_glue.h', 'libcef/browser_webkit_glue_win.cc', diff --git a/libcef/browser_drag_delegate.cc b/libcef/browser_drag_delegate.cc index e398e1a81..152b47745 100644 --- a/libcef/browser_drag_delegate.cc +++ b/libcef/browser_drag_delegate.cc @@ -6,10 +6,10 @@ #include "browser_drag_delegate.h" #include "webkit/api/public/WebPoint.h" -#include "webkit/glue/webview.h" +#include "webkit/api/public/WebView.h" using WebKit::WebPoint; - +using WebKit::WebView; namespace { diff --git a/libcef/browser_drag_delegate.h b/libcef/browser_drag_delegate.h index b402b8b50..34e80a723 100644 --- a/libcef/browser_drag_delegate.h +++ b/libcef/browser_drag_delegate.h @@ -10,11 +10,13 @@ #include "base/base_drag_source.h" +namespace WebKit { class WebView; +} class BrowserDragDelegate : public BaseDragSource { public: - BrowserDragDelegate(HWND source_hwnd, WebView* webview) + BrowserDragDelegate(HWND source_hwnd, WebKit::WebView* webview) : BaseDragSource(), source_hwnd_(source_hwnd), webview_(webview) { } @@ -26,7 +28,7 @@ class BrowserDragDelegate : public BaseDragSource { virtual void OnDragSourceMove(); private: - WebView* webview_; + WebKit::WebView* webview_; // A HWND for the source we are associated with, used for translating // mouse coordinates from screen to client coordinates. diff --git a/libcef/browser_drop_delegate.cc b/libcef/browser_drop_delegate.cc index d7cdc90de..958304bdd 100644 --- a/libcef/browser_drop_delegate.cc +++ b/libcef/browser_drop_delegate.cc @@ -7,12 +7,13 @@ #include "webkit/api/public/WebDragData.h" #include "webkit/api/public/WebPoint.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webdropdata.h" -#include "webkit/glue/webview.h" using WebKit::WebDragOperation; using WebKit::WebDragOperationCopy; using WebKit::WebPoint; +using WebKit::WebView; // BaseDropTarget methods ---------------------------------------------------- diff --git a/libcef/browser_drop_delegate.h b/libcef/browser_drop_delegate.h index 344f5a79a..80af8cd6f 100644 --- a/libcef/browser_drop_delegate.h +++ b/libcef/browser_drop_delegate.h @@ -10,11 +10,13 @@ #include "base/base_drop_target.h" +namespace WebKit { class WebView; +} class BrowserDropDelegate : public BaseDropTarget { public: - BrowserDropDelegate(HWND source_hwnd, WebView* webview) + BrowserDropDelegate(HWND source_hwnd, WebKit::WebView* webview) : BaseDropTarget(source_hwnd), webview_(webview) { } @@ -36,7 +38,7 @@ class BrowserDropDelegate : public BaseDropTarget { private: - WebView* webview_; + WebKit::WebView* webview_; }; #endif // _BROWSER_DROP_DELEGATE_H diff --git a/libcef/browser_impl.cc b/libcef/browser_impl.cc index 832f60f37..565ff89b8 100644 --- a/libcef/browser_impl.cc +++ b/libcef/browser_impl.cc @@ -14,6 +14,7 @@ #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebURL.h" #include "webkit/api/public/WebURLRequest.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/glue_serialize.h" #include "webkit/glue/glue_util.h" @@ -23,6 +24,7 @@ using WebKit::WebScriptSource; using WebKit::WebString; using WebKit::WebURL; using WebKit::WebURLRequest; +using WebKit::WebView; using webkit_glue::StdStringToWebString; using webkit_glue::WebStringToStdString; @@ -673,3 +675,12 @@ void CefBrowserImpl::UIT_HandleAction(CefHandler::MenuId menuId, if(frame) frame->Release(); } + + +// CefFrameImpl + +bool CefFrameImpl::IsFocused() +{ + return (browser_->GetWebFrame(this) == + browser_->GetWebView()->focusedFrame()); +} diff --git a/libcef/browser_impl.h b/libcef/browser_impl.h index d9f030de6..31ff854a2 100644 --- a/libcef/browser_impl.h +++ b/libcef/browser_impl.h @@ -16,7 +16,9 @@ #include "printing/win_printing_context.h" #endif -#include "webkit/glue/webview.h" +namespace WebKit { +class WebView; +} #define BUFFER_SIZE 32768 @@ -91,7 +93,7 @@ public: int startLine); virtual std::wstring GetURL(CefRefPtr frame); - WebView* GetWebView() const { + WebKit::WebView* GetWebView() const { return webviewhost_.get() ? webviewhost_->webview() : NULL; } WebViewHost* GetWebViewHost() const { @@ -272,9 +274,7 @@ public: int startLine) { return browser_->ExecuteJavaScript(this, jsCode, scriptUrl, startLine); } virtual bool IsMain() { return name_.empty(); } - virtual bool IsFocused() - { return (browser_->GetWebFrame(this) == - browser_->GetWebView()->focusedFrame()); } + virtual bool IsFocused(); virtual std::wstring GetName() { return name_; } virtual std::wstring GetURL() { return browser_->GetURL(this); } diff --git a/libcef/browser_impl_win.cc b/libcef/browser_impl_win.cc index b1630dda3..ef6bbe89c 100644 --- a/libcef/browser_impl_win.cc +++ b/libcef/browser_impl_win.cc @@ -15,6 +15,7 @@ #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebRect.h" #include "webkit/api/public/WebSize.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webkit_glue.h" #include diff --git a/libcef/browser_resource_loader_bridge.cc b/libcef/browser_resource_loader_bridge.cc index d123e80a3..613a48818 100644 --- a/libcef/browser_resource_loader_bridge.cc +++ b/libcef/browser_resource_loader_bridge.cc @@ -34,6 +34,7 @@ #include "browser_appcache_system.h" #include "browser_resource_loader_bridge.h" #include "browser_request_context.h" +#include "browser_socket_stream_bridge.h" #include "browser_impl.h" #include "request_impl.h" @@ -55,9 +56,9 @@ #include "net/proxy/proxy_service.h" #include "net/url_request/url_request.h" #include "webkit/api/public/WebFrame.h" +#include "webkit/api/public/WebView.h" #include "webkit/appcache/appcache_interfaces.h" #include "webkit/glue/resource_loader_bridge.h" -#include "webkit/glue/webview.h" using webkit_glue::ResourceLoaderBridge; using net::CookiePolicy; @@ -83,9 +84,11 @@ class IOThread : public base::Thread { virtual void Init() { BrowserAppCacheSystem::InitializeOnIOThread(request_context); + BrowserSocketStreamBridge::InitializeOnIOThread(request_context); } virtual void CleanUp() { + BrowserSocketStreamBridge::Cleanup(); if (request_context) { request_context->Release(); request_context = NULL; diff --git a/libcef/browser_socket_stream_bridge.cc b/libcef/browser_socket_stream_bridge.cc new file mode 100644 index 000000000..2a94cdef8 --- /dev/null +++ b/libcef/browser_socket_stream_bridge.cc @@ -0,0 +1,227 @@ +// Copyright (c) 2009 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 + +#include "browser_socket_stream_bridge.h" + +#include "base/message_loop.h" +#include "base/ref_counted.h" +#include "googleurl/src/gurl.h" +#include "net/socket_stream/socket_stream.h" +#include "net/url_request/url_request_context.h" +#include "webkit/api/public/WebSocketStreamHandle.h" +#include "webkit/glue/websocketstreamhandle_bridge.h" +#include "webkit/glue/websocketstreamhandle_delegate.h" + +using webkit_glue::WebSocketStreamHandleBridge; + +static const int kNoSocketId = 0; + +namespace { + +MessageLoop* g_io_thread; +scoped_refptr g_request_context; + +class WebSocketStreamHandleBridgeImpl + : public base::RefCountedThreadSafe, + public WebSocketStreamHandleBridge, + public net::SocketStream::Delegate { + public: + WebSocketStreamHandleBridgeImpl( + WebKit::WebSocketStreamHandle* handle, + webkit_glue::WebSocketStreamHandleDelegate* delegate); + virtual ~WebSocketStreamHandleBridgeImpl(); + + // WebSocketStreamHandleBridge methods. + virtual void Connect(const GURL& url); + virtual bool Send(const std::vector& data); + virtual void Close(); + + // net::SocketStream::Delegate methods. + virtual void OnConnected(net::SocketStream* req, + int max_pending_send_allowed); + virtual void OnSentData(net::SocketStream* req, + int amount_sent); + virtual void OnReceivedData(net::SocketStream* req, + const char* data, int len); + virtual void OnClose(net::SocketStream* req); + + + private: + // Runs on |g_io_thread|; + void DoConnect(const GURL& url); + void DoSend(std::vector* data); + void DoClose(); + + // Runs on |message_loop_|; + void DoOnConnected(int max_amount_send_allowed); + void DoOnSentData(int amount_sent); + void DoOnReceivedData(std::vector* data); + void DoOnClose(webkit_glue::WebSocketStreamHandleDelegate* delegate); + + int socket_id_; + MessageLoop* message_loop_; + WebKit::WebSocketStreamHandle* handle_; + webkit_glue::WebSocketStreamHandleDelegate* delegate_; + + scoped_refptr socket_; + + DISALLOW_COPY_AND_ASSIGN(WebSocketStreamHandleBridgeImpl); +}; + +WebSocketStreamHandleBridgeImpl::WebSocketStreamHandleBridgeImpl( + WebKit::WebSocketStreamHandle* handle, + webkit_glue::WebSocketStreamHandleDelegate* delegate) + : socket_id_(kNoSocketId), + message_loop_(MessageLoop::current()), + handle_(handle), + delegate_(delegate) { +} + +WebSocketStreamHandleBridgeImpl::~WebSocketStreamHandleBridgeImpl() { + CHECK(socket_id_ == kNoSocketId); +} + +void WebSocketStreamHandleBridgeImpl::Connect(const GURL& url) { + CHECK(g_io_thread); + AddRef(); // Released in DoOnClose(). + g_io_thread->PostTask( + FROM_HERE, + NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoConnect, + url)); + if (delegate_) + delegate_->WillOpenStream(handle_, url); +} + +bool WebSocketStreamHandleBridgeImpl::Send( + const std::vector& data) { + CHECK(g_io_thread); + g_io_thread->PostTask( + FROM_HERE, + NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoSend, + new std::vector(data))); + return true; +} + +void WebSocketStreamHandleBridgeImpl::Close() { + CHECK(g_io_thread); + g_io_thread->PostTask( + FROM_HERE, + NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoClose)); +} + +void WebSocketStreamHandleBridgeImpl::OnConnected( + net::SocketStream* socket, int max_pending_send_allowed) { + message_loop_->PostTask( + FROM_HERE, + NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnConnected, + max_pending_send_allowed)); +} + +void WebSocketStreamHandleBridgeImpl::OnSentData( + net::SocketStream* socket, int amount_sent) { + message_loop_->PostTask( + FROM_HERE, + NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnSentData, + amount_sent)); +} + +void WebSocketStreamHandleBridgeImpl::OnReceivedData( + net::SocketStream* socket, const char* data, int len) { + message_loop_->PostTask( + FROM_HERE, + NewRunnableMethod(this, + &WebSocketStreamHandleBridgeImpl::DoOnReceivedData, + new std::vector(data, data + len))); +} + +void WebSocketStreamHandleBridgeImpl::OnClose(net::SocketStream* socket) { + webkit_glue::WebSocketStreamHandleDelegate* delegate = delegate_; + delegate_ = NULL; + socket_ = 0; + socket_id_ = kNoSocketId; + message_loop_->PostTask( + FROM_HERE, + NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnClose, + delegate)); +} + +void WebSocketStreamHandleBridgeImpl::DoConnect(const GURL& url) { + CHECK(MessageLoop::current() == g_io_thread); + socket_ = new net::SocketStream(url, this); + socket_->set_context(g_request_context); + socket_->Connect(); +} + +void WebSocketStreamHandleBridgeImpl::DoSend(std::vector* data) { + CHECK(MessageLoop::current() == g_io_thread); + scoped_ptr > scoped_data(data); + if (!socket_) + return; + if (!socket_->SendData(&(data->at(0)), data->size())) + socket_->Close(); +} + +void WebSocketStreamHandleBridgeImpl::DoClose() { + CHECK(MessageLoop::current() == g_io_thread); + if (!socket_) + return; + socket_->Close(); +} + +void WebSocketStreamHandleBridgeImpl::DoOnConnected( + int max_pending_send_allowed) { + CHECK(MessageLoop::current() == message_loop_); + if (delegate_) + delegate_->DidOpenStream(handle_, max_pending_send_allowed); +} + +void WebSocketStreamHandleBridgeImpl::DoOnSentData(int amount_sent) { + CHECK(MessageLoop::current() == message_loop_); + if (delegate_) + delegate_->DidSendData(handle_, amount_sent); +} + +void WebSocketStreamHandleBridgeImpl::DoOnReceivedData( + std::vector* data) { + CHECK(MessageLoop::current() == message_loop_); + scoped_ptr > scoped_data(data); + if (delegate_) + delegate_->DidReceiveData(handle_, &(data->at(0)), data->size()); +} + +void WebSocketStreamHandleBridgeImpl::DoOnClose( + webkit_glue::WebSocketStreamHandleDelegate* delegate) { + CHECK(MessageLoop::current() == message_loop_); + CHECK(!socket_); + if (delegate) + delegate->DidClose(handle_); + Release(); +} + +} // namespace + +/* static */ +void BrowserSocketStreamBridge::InitializeOnIOThread( + URLRequestContext* request_context) { + g_io_thread = MessageLoop::current(); + g_request_context = request_context; +} + +void BrowserSocketStreamBridge::Cleanup() { + g_io_thread = NULL; + g_request_context = NULL; +} + +namespace webkit_glue { + +/* static */ +WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create( + WebKit::WebSocketStreamHandle* handle, + WebSocketStreamHandleDelegate* delegate) { + return new WebSocketStreamHandleBridgeImpl(handle, delegate); +} + +} // namespace webkit_glue diff --git a/libcef/browser_socket_stream_bridge.h b/libcef/browser_socket_stream_bridge.h new file mode 100644 index 000000000..9ae9fd93c --- /dev/null +++ b/libcef/browser_socket_stream_bridge.h @@ -0,0 +1,16 @@ +// Copyright (c) 2009 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 _BROWSER_SOCKET_STREAM_BRIDGE_H +#define _BROWSER_SOCKET_STREAM_BRIDGE_H + +class URLRequestContext; + +class BrowserSocketStreamBridge { + public: + static void InitializeOnIOThread(URLRequestContext* request_context); + static void Cleanup(); +}; + +#endif // _BROWSER_SOCKET_STREAM_BRIDGE_H diff --git a/libcef/browser_webkit_glue.h b/libcef/browser_webkit_glue.h index 21a56d25d..a2b0abe88 100644 --- a/libcef/browser_webkit_glue.h +++ b/libcef/browser_webkit_glue.h @@ -12,15 +12,15 @@ namespace WebKit { class WebFrame; -} class WebView; +} namespace webkit_glue { #if defined(OS_WIN) // Capture a bitmap of the web view. -void CaptureWebViewBitmap(HWND mainWnd, WebView* webview, HBITMAP& bitmap, - SIZE& size); +void CaptureWebViewBitmap(HWND mainWnd, WebKit::WebView* webview, + HBITMAP& bitmap, SIZE& size); // Save a bitmap image to file, providing optional alternative data in |lpBits| BOOL SaveBitmapToFile(HBITMAP hBmp, HDC hDC, LPCTSTR file, LPBYTE lpBits); diff --git a/libcef/browser_webkit_glue_win.cc b/libcef/browser_webkit_glue_win.cc index b3ead7611..8316b3900 100644 --- a/libcef/browser_webkit_glue_win.cc +++ b/libcef/browser_webkit_glue_win.cc @@ -22,12 +22,13 @@ MSVC_POP_WARNING(); #include "skia/ext/platform_canvas.h" #include "webkit/api/public/WebRect.h" #include "webkit/api/public/WebSize.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/glue/plugins/plugin_list.h" using WebKit::WebRect; using WebKit::WebSize; +using WebKit::WebView; namespace webkit_glue { diff --git a/libcef/browser_webkit_init.h b/libcef/browser_webkit_init.h index dcab12436..db561b971 100644 --- a/libcef/browser_webkit_init.h +++ b/libcef/browser_webkit_init.h @@ -47,6 +47,7 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl { ASCIIToUTF16(webkit_glue::GetUIResourceProtocol())); WebKit::registerExtension(extensions_v8::GearsExtension::Get()); WebKit::registerExtension(extensions_v8::IntervalExtension::Get()); + WebKit::enableWebSockets(); // Load libraries for media and enable the media player. FilePath module_path; diff --git a/libcef/browser_webview_delegate.cc b/libcef/browser_webview_delegate.cc index 3b523ff99..126b2aff4 100644 --- a/libcef/browser_webview_delegate.cc +++ b/libcef/browser_webview_delegate.cc @@ -45,6 +45,7 @@ #include "webkit/api/public/WebURLError.h" #include "webkit/api/public/WebURLRequest.h" #include "webkit/api/public/WebURLResponse.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/glue_serialize.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/media/buffered_data_source.h" @@ -54,7 +55,6 @@ #include "webkit/glue/webplugin_impl.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/plugins/webplugin_delegate_impl.h" #include "webkit/glue/webmediaplayer_impl.h" @@ -98,6 +98,7 @@ using WebKit::WebURL; using WebKit::WebURLError; using WebKit::WebURLRequest; using WebKit::WebURLResponse; +using WebKit::WebView; using WebKit::WebWidget; using WebKit::WebWorker; using WebKit::WebWorkerClient; @@ -543,6 +544,33 @@ WebNavigationPolicy BrowserWebViewDelegate::decidePolicyForNavigation( return result; } +bool BrowserWebViewDelegate::canHandleRequest( + WebFrame* frame, const WebURLRequest& request) { + return true; +} + +WebURLError BrowserWebViewDelegate::cannotHandleRequestError( + WebFrame* frame, const WebURLRequest& request) { + WebURLError error; + error.domain = WebString::fromUTF8(net::kErrorDomain); + error.reason = net::ERR_ABORTED; + error.unreachableURL = request.url(); + return error; +} + +WebURLError BrowserWebViewDelegate::cancelledError( + WebFrame* frame, const WebURLRequest& request) { + WebURLError error; + error.domain = WebString::fromUTF8(net::kErrorDomain); + error.reason = net::ERR_ABORTED; + error.unreachableURL = request.url(); + return error; +} + +void BrowserWebViewDelegate::unableToImplementPolicyWithError( + WebFrame* frame, const WebURLError& error) { +} + void BrowserWebViewDelegate::willSubmitForm(WebFrame* frame, const WebForm&) { // Ignore } diff --git a/libcef/browser_webview_delegate.h b/libcef/browser_webview_delegate.h index 69438c0c2..4c55a204d 100644 --- a/libcef/browser_webview_delegate.h +++ b/libcef/browser_webview_delegate.h @@ -24,9 +24,9 @@ #include "webkit/api/public/WebContextMenuData.h" #include "webkit/api/public/WebFrameClient.h" #include "webkit/api/public/WebRect.h" +#include "webkit/api/public/WebViewClient.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webplugin_page_delegate.h" -#include "webkit/glue/webview_delegate.h" #if defined(OS_WIN) #include "browser_drag_delegate.h" #include "browser_drop_delegate.h" @@ -38,13 +38,13 @@ struct WebPreferences; class GURL; class WebWidgetHost; -class BrowserWebViewDelegate : public WebViewDelegate, +class BrowserWebViewDelegate : public WebKit::WebViewClient, public WebKit::WebFrameClient, public webkit_glue::WebPluginPageDelegate, public base::SupportsWeakPtr { public: // WebKit::WebViewClient - virtual WebView* createView(WebKit::WebFrame* creator); + virtual WebKit::WebView* createView(WebKit::WebFrame* creator); virtual WebKit::WebWidget* createPopupMenu(bool activatable); virtual WebKit::WebWidget* createPopupMenu( const WebKit::WebPopupMenuInfo& info); @@ -156,6 +156,14 @@ class BrowserWebViewDelegate : public WebViewDelegate, WebKit::WebFrame*, const WebKit::WebURLRequest&, WebKit::WebNavigationType, const WebKit::WebNode&, WebKit::WebNavigationPolicy default_policy, bool isRedirect); + virtual bool canHandleRequest( + WebKit::WebFrame*, const WebKit::WebURLRequest&); + virtual WebKit::WebURLError cannotHandleRequestError( + WebKit::WebFrame*, const WebKit::WebURLRequest& request); + virtual WebKit::WebURLError cancelledError( + WebKit::WebFrame*, const WebKit::WebURLRequest& request); + virtual void unableToImplementPolicyWithError( + WebKit::WebFrame*, const WebKit::WebURLError&); virtual void willSubmitForm(WebKit::WebFrame*, const WebKit::WebForm&); virtual void willPerformClientRedirect( WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, @@ -275,7 +283,7 @@ class BrowserWebViewDelegate : public WebViewDelegate, protected: // Called when the URL of the page changes. - void UpdateAddressBar(WebView* webView); + void UpdateAddressBar(WebKit::WebView* webView); // Default handling of JavaScript messages. void ShowJavaScriptAlert(WebKit::WebFrame* webframe, diff --git a/libcef/browser_webview_delegate_win.cc b/libcef/browser_webview_delegate_win.cc index 3a7a0edcd..beac2daed 100644 --- a/libcef/browser_webview_delegate_win.cc +++ b/libcef/browser_webview_delegate_win.cc @@ -29,11 +29,11 @@ #include "webkit/api/public/WebCursorInfo.h" #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebRect.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webplugin.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/plugins/webplugin_delegate_impl.h" #include "webkit/glue/window_open_disposition.h" diff --git a/libcef/webview_host.cc b/libcef/webview_host.cc index d743eb656..c3f972a3d 100644 --- a/libcef/webview_host.cc +++ b/libcef/webview_host.cc @@ -8,8 +8,10 @@ #include "base/gfx/rect.h" #include "base/gfx/size.h" #include "base/win_util.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" + +using namespace WebKit; static const wchar_t kWindowClassName[] = L"WebViewHost"; @@ -38,7 +40,7 @@ WebViewHost* WebViewHost::Create(HWND parent_view, GetModuleHandle(NULL), NULL); win_util::SetWindowUserData(host->view_, host); - host->webwidget_ = WebView::Create(delegate); + host->webwidget_ = WebView::create(delegate); prefs.Apply(host->webview()); host->webview()->initializeMainFrame(delegate); diff --git a/libcef/webview_host.h b/libcef/webview_host.h index 791a3a061..7efc4a6f4 100644 --- a/libcef/webview_host.h +++ b/libcef/webview_host.h @@ -11,9 +11,12 @@ #include "webwidget_host.h" struct WebPreferences; -class WebView; class BrowserWebViewDelegate; +namespace WebKit { +class WebView; +} + // This class is a simple ViewHandle-based host for a WebView class WebViewHost : public WebWidgetHost { public: @@ -24,7 +27,7 @@ class WebViewHost : public WebWidgetHost { BrowserWebViewDelegate* delegate, const WebPreferences& prefs); - WebView* webview() const; + WebKit::WebView* webview() const; protected: #if defined(OS_WIN)