libcef: Update due to underlying chromium changes.

- Modifications due to WebFrame moving from webkit/glue to webkit/api
- Remove the ATL dependency from browser_drag_delegate.cc
- Use scoped_refptr instead of scoped_ptr for BrowserWebViewDelegate pointers in CefBrowserImpl.
- Allow cancellation of redirects before they're sent in browser_resource_loader_bridge.cc
- Enable remote fonts, local storage and session storage in context.cc
- Add vsprops files to the libcef project that used to exist in the webkit/build directory

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@34 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2009-08-13 17:23:08 +00:00
parent ea3a49abe1
commit cbb3124475
20 changed files with 429 additions and 309 deletions

View File

@@ -19,8 +19,7 @@
#endif
#include "base/basictypes.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/linked_ptr.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webview_delegate.h"
#if defined(OS_WIN)
@@ -35,29 +34,13 @@ struct WebPreferences;
class GURL;
class WebWidgetHost;
class BrowserWebViewDelegate : public base::RefCounted<BrowserWebViewDelegate>,
public WebViewDelegate {
class BrowserWebViewDelegate : public WebViewDelegate {
public:
BrowserWebViewDelegate(CefBrowserImpl* browser)
: policy_delegate_enabled_(false),
policy_delegate_is_permissive_(false),
browser_(browser),
top_loading_frame_(NULL),
page_id_(-1),
last_page_id_updated_(-1),
smart_insert_delete_enabled_(true)
#if defined(OS_WIN)
, select_trailing_whitespace_enabled_(true)
#else
, select_trailing_whitespace_enabled_(false)
#endif
#if defined(OS_LINUX)
, cursor_type_(GDK_X_CURSOR)
#endif
{
}
BrowserWebViewDelegate(CefBrowserImpl* browser);
virtual ~BrowserWebViewDelegate() {}
void Reset();
// WebViewDelegate
virtual WebView* CreateWebView(WebView* webview,
bool user_gesture,
@@ -79,11 +62,11 @@ class BrowserWebViewDelegate : public base::RefCounted<BrowserWebViewDelegate>,
const GURL& referrer,
WebKit::WebNavigationPolicy policy);
virtual void DidMovePlugin(const WebPluginGeometry& move);
virtual void RunJavaScriptAlert(WebFrame* webframe,
virtual void RunJavaScriptAlert(WebKit::WebFrame* webframe,
const std::wstring& message);
virtual bool RunJavaScriptConfirm(WebFrame* webframe,
virtual bool RunJavaScriptConfirm(WebKit::WebFrame* webframe,
const std::wstring& message);
virtual bool RunJavaScriptPrompt(WebFrame* webframe,
virtual bool RunJavaScriptPrompt(WebKit::WebFrame* webframe,
const std::wstring& message,
const std::wstring& default_value,
std::wstring* result);
@@ -109,55 +92,63 @@ class BrowserWebViewDelegate : public base::RefCounted<BrowserWebViewDelegate>,
int edit_flags,
const std::string& security_info,
const std::string& frame_charset);
virtual void DidCreateDataSource(WebFrame* frame,
virtual void DidCreateDataSource(WebKit::WebFrame* frame,
WebKit::WebDataSource* ds);
virtual void DidStartProvisionalLoadForFrame(
WebView* webview,
WebFrame* frame,
WebKit::WebFrame* frame,
NavigationGesture gesture);
virtual void DidReceiveServerRedirectForProvisionalLoadForFrame(
WebView* webview, WebFrame* frame);
virtual void DidReceiveProvisionalLoadServerRedirect(
WebView* webview, WebKit::WebFrame* frame);
virtual void DidFailProvisionalLoadWithError(
WebView* webview,
const WebKit::WebURLError& error,
WebFrame* frame);
virtual void DidCommitLoadForFrame(WebView* webview, WebFrame* frame,
bool is_new_navigation);
WebKit::WebFrame* frame);
virtual void DidCommitLoadForFrame(
WebView* webview,
WebKit::WebFrame* frame,
bool is_new_navigation);
virtual void DidReceiveTitle(WebView* webview,
const std::wstring& title,
WebFrame* frame);
WebKit::WebFrame* frame);
virtual void DidFinishDocumentLoadForFrame(WebView* webview,
WebFrame* frame);
WebKit::WebFrame* frame);
virtual void DidHandleOnloadEventsForFrame(WebView* webview,
WebFrame* frame);
WebKit::WebFrame* frame);
virtual void DidChangeLocationWithinPageForFrame(WebView* webview,
WebFrame* frame,
WebKit::WebFrame* frame,
bool is_new_navigation);
virtual void DidReceiveIconForFrame(WebView* webview, WebFrame* frame);
virtual void DidReceiveIconForFrame(WebView* webview,
WebKit::WebFrame* frame);
virtual void WillPerformClientRedirect(WebView* webview,
WebFrame* frame,
const std::wstring& dest_url,
WebKit::WebFrame* frame,
const GURL& src_url,
const GURL& dest_url,
unsigned int delay_seconds,
unsigned int fire_date);
virtual void DidCancelClientRedirect(WebView* webview,
WebFrame* frame);
WebKit::WebFrame* frame);
virtual void DidFinishLoadForFrame(WebView* webview, WebFrame* frame);
virtual void DidFinishLoadForFrame(WebView* webview, WebKit::WebFrame* frame);
virtual void DidFailLoadWithError(WebView* webview,
const WebKit::WebURLError& error,
WebFrame* for_frame);
WebKit::WebFrame* for_frame);
virtual void AssignIdentifierToRequest(WebView* webview,
virtual void AssignIdentifierToRequest(WebKit::WebFrame* webframe,
uint32 identifier,
const WebKit::WebURLRequest& request);
virtual void WillSendRequest(WebView* webview,
virtual void WillSendRequest(WebKit::WebFrame* webframe,
uint32 identifier,
WebKit::WebURLRequest* request);
virtual void DidFinishLoading(WebView* webview, uint32 identifier);
virtual void DidFailLoadingWithError(WebView* webview,
WebKit::WebURLRequest* request,
const WebKit::WebURLResponse& redirect_response);
virtual void DidFinishLoading(WebKit::WebFrame* webframe, uint32 identifier);
virtual void DidFailLoadingWithError(WebKit::WebFrame* webframe,
uint32 identifier,
const WebKit::WebURLError& error);
virtual void DidReceiveResponse(WebKit::WebFrame* webframe,
uint32 identifier,
const WebKit::WebURLResponse& response);
virtual bool ShouldBeginEditing(WebView* webview, std::wstring range);
virtual bool ShouldEndEditing(WebView* webview, std::wstring range);
@@ -187,10 +178,10 @@ class BrowserWebViewDelegate : public base::RefCounted<BrowserWebViewDelegate>,
virtual void DidStartLoading(WebView* webview);
virtual void DidStopLoading(WebView* webview);
virtual void WindowObjectCleared(WebFrame* webframe);
virtual void WindowObjectCleared(WebKit::WebFrame* webframe);
virtual WebKit::WebNavigationPolicy PolicyForNavigationAction(
WebView* webview,
WebFrame* frame,
WebKit::WebFrame* frame,
const WebKit::WebURLRequest& request,
WebKit::WebNavigationType type,
WebKit::WebNavigationPolicy default_policy,
@@ -220,7 +211,7 @@ class BrowserWebViewDelegate : public base::RefCounted<BrowserWebViewDelegate>,
void SetSelectTrailingWhitespaceEnabled(bool enabled);
// Additional accessors
WebFrame* top_loading_frame() { return top_loading_frame_; }
WebKit::WebFrame* top_loading_frame() { return top_loading_frame_; }
#if defined(OS_WIN)
IDropTarget* drop_delegate() { return drop_delegate_.get(); }
IDropSource* drag_delegate() { return drag_delegate_.get(); }
@@ -236,10 +227,20 @@ class BrowserWebViewDelegate : public base::RefCounted<BrowserWebViewDelegate>,
// Sets the webview as a drop target.
void RegisterDragDrop();
void RevokeDragDrop();
void ResetDragDrop();
void SetCustomPolicyDelegate(bool is_custom, bool is_permissive);
void WaitForPolicyDelegate();
void set_block_redirects(bool block_redirects) {
block_redirects_ = block_redirects;
}
bool block_redirects() const {
return block_redirects_;
}
CefBrowserImpl* GetBrowser() { return browser_; }
protected:
@@ -247,24 +248,26 @@ class BrowserWebViewDelegate : public base::RefCounted<BrowserWebViewDelegate>,
void UpdateAddressBar(WebView* webView);
// Default handling of JavaScript messages.
void ShowJavaScriptAlert(WebFrame* webframe, const std::wstring& message);
bool ShowJavaScriptConfirm(WebFrame* webframe, const std::wstring& message);
bool ShowJavaScriptPrompt(WebFrame* webframe, const std::wstring& message,
const std::wstring& default_value, std::wstring* result);
void ShowJavaScriptAlert(WebKit::WebFrame* webframe,
const std::wstring& message);
bool ShowJavaScriptConfirm(WebKit::WebFrame* webframe,
const std::wstring& message);
bool ShowJavaScriptPrompt(WebKit::WebFrame* webframe,
const std::wstring& message,
const std::wstring& default_value,
std::wstring* result);
// In the Mac code, this is called to trigger the end of a test after the
// page has finished loading. From here, we can generate the dump for the
// test.
void LocationChangeDone(WebFrame*);
void LocationChangeDone(WebKit::WebFrame*);
WebWidgetHost* GetWidgetHost();
void UpdateForCommittedLoad(WebFrame* webframe, bool is_new_navigation);
void UpdateURL(WebFrame* frame);
void UpdateSessionHistory(WebFrame* frame);
// Get a string suitable for dumping a frame to the console.
std::wstring GetFrameDescription(WebFrame* webframe);
void UpdateForCommittedLoad(WebKit::WebFrame* webframe,
bool is_new_navigation);
void UpdateURL(WebKit::WebFrame* frame);
void UpdateSessionHistory(WebKit::WebFrame* frame);
private:
// Causes navigation actions just printout the intended navigation instead
@@ -280,19 +283,13 @@ class BrowserWebViewDelegate : public base::RefCounted<BrowserWebViewDelegate>,
CefBrowserImpl* browser_;
// This is non-NULL IFF a load is in progress.
WebFrame* top_loading_frame_;
WebKit::WebFrame* top_loading_frame_;
// For tracking session history. See RenderView.
int page_id_;
int last_page_id_updated_;
scoped_ptr<BrowserExtraData> pending_extra_data_;
// true if we want to enable smart insert/delete.
bool smart_insert_delete_enabled_;
// true if we want to enable selection of trailing whitespaces
bool select_trailing_whitespace_enabled_;
linked_ptr<BrowserExtraData> pending_extra_data_;
WebCursor current_cursor_;
#if defined(OS_WIN)
@@ -308,7 +305,14 @@ class BrowserWebViewDelegate : public base::RefCounted<BrowserWebViewDelegate>,
GdkCursorType cursor_type_;
#endif
DISALLOW_COPY_AND_ASSIGN(BrowserWebViewDelegate);
// true if we want to enable smart insert/delete.
bool smart_insert_delete_enabled_;
// true if we want to enable selection of trailing whitespaces
bool select_trailing_whitespace_enabled_;
// true if we should block any redirects
bool block_redirects_;
};
#endif // _BROWSER_WEBVIEW_DELEGATE_H