From 07e81ab0a01d34f1a96326633e98bd7d5759c26c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 22 Sep 2009 16:34:27 +0000 Subject: [PATCH] libcef: Update due to underlying chromium changes. - WebEditingClient merged into WebViewClient requiring changes to BrowserWebViewDelegate. - Remove webkit_glue_plugins.patch for RegisterInternalPlugin() issue 173107 which has been committed as Chromium rev 26595. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@48 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- CHROMIUM_BUILD_COMPATIBILITY.txt | 3 + libcef/browser_webkit_glue.cc | 6 ++ libcef/browser_webview_delegate.cc | 123 ++++++++++++------------ libcef/browser_webview_delegate.h | 50 +++++----- libcef/webview_host.cc | 2 +- patch/patch.cfg | 2 - patch/patches/webkit_glue_plugins.patch | 35 ------- 7 files changed, 95 insertions(+), 126 deletions(-) delete mode 100644 patch/patches/webkit_glue_plugins.patch diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index a918f90ae..faea90ac8 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -37,3 +37,6 @@ Date | CEF Revision | Chromium Revision 2009-08-20 | /trunk@35 | /trunk@23814 2009-08-25 | /trunk@41 | /trunk@24210 2009-09-17 | /trunk@42 | /trunk@26432 + After syncing to rev 26432 you must manually run 'gclient runhooks --force'. + Earlier and later revisions do not have this requirement. +2009-09-22 | /trunk@48 | /trunk@26790 diff --git a/libcef/browser_webkit_glue.cc b/libcef/browser_webkit_glue.cc index e82f29771..297881a97 100644 --- a/libcef/browser_webkit_glue.cc +++ b/libcef/browser_webkit_glue.cc @@ -175,6 +175,12 @@ bool IsDefaultPluginEnabled() { return false; } +bool IsProtocolSupportedForMedia(const GURL& url) { + if (url.SchemeIsFile() || url.SchemeIs("http") || url.SchemeIs("https")) + return true; + return false; +} + std::wstring GetWebKitLocale() { return L"en-US"; } diff --git a/libcef/browser_webview_delegate.cc b/libcef/browser_webview_delegate.cc index f83a6c150..6d2b243bc 100644 --- a/libcef/browser_webview_delegate.cc +++ b/libcef/browser_webview_delegate.cc @@ -88,6 +88,7 @@ using WebKit::WebPopupMenu; using WebKit::WebRange; using WebKit::WebRect; using WebKit::WebScreenInfo; +using WebKit::WebSecurityOrigin; using WebKit::WebSize; using WebKit::WebString; using WebKit::WebTextAffinity; @@ -178,6 +179,66 @@ void BrowserWebViewDelegate::didStopLoading() { } } +bool BrowserWebViewDelegate::shouldBeginEditing(const WebRange& range) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldEndEditing(const WebRange& range) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldInsertNode(const WebNode& node, + const WebRange& range, + WebEditingAction action) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldInsertText(const WebString& text, + const WebRange& range, + WebEditingAction action) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldChangeSelectedRange(const WebRange& from_range, + const WebRange& to_range, + WebTextAffinity affinity, + bool still_selecting) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldDeleteRange(const WebRange& range) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldApplyStyle(const WebString& style, + const WebRange& range) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::isSmartInsertDeleteEnabled() { + return smart_insert_delete_enabled_; +} + +bool BrowserWebViewDelegate::isSelectTrailingWhitespaceEnabled() { + return select_trailing_whitespace_enabled_; +} + +void BrowserWebViewDelegate::didBeginEditing() { +} + +void BrowserWebViewDelegate::didChangeSelection(bool is_empty_selection) { +} + +void BrowserWebViewDelegate::didChangeContents() { +} + +void BrowserWebViewDelegate::didExecuteCommand( + const WebKit::WebString& command_name) { +} + +void BrowserWebViewDelegate::didEndEditing() { +} + void BrowserWebViewDelegate::runModalAlertDialog( WebFrame* frame, const WebString& message) { std::wstring messageStr = UTF16ToWideHack(message); @@ -332,66 +393,6 @@ WebScreenInfo BrowserWebViewDelegate::screenInfo() { return WebScreenInfo(); } -// WebEditingClient ---------------------------------------------------------- -// The output from these methods in layout test mode should match that -// expected by the layout tests. See EditingDelegate.m in DumpRenderTree. - -bool BrowserWebViewDelegate::shouldBeginEditing(const WebRange& range) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::shouldEndEditing(const WebRange& range) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::shouldInsertNode(const WebNode& node, - const WebRange& range, - WebEditingAction action) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::shouldInsertText(const WebString& text, - const WebRange& range, - WebEditingAction action) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::shouldChangeSelectedRange(const WebRange& from_range, - const WebRange& to_range, - WebTextAffinity affinity, - bool still_selecting) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::shouldDeleteRange(const WebRange& range) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::shouldApplyStyle(const WebString& style, - const WebRange& range) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::isSmartInsertDeleteEnabled() { - return smart_insert_delete_enabled_; -} - -bool BrowserWebViewDelegate::isSelectTrailingWhitespaceEnabled() { - return select_trailing_whitespace_enabled_; -} - -void BrowserWebViewDelegate::didBeginEditing() { -} - -void BrowserWebViewDelegate::didChangeSelection(bool is_empty_selection) { -} - -void BrowserWebViewDelegate::didChangeContents() { -} - -void BrowserWebViewDelegate::didEndEditing() { -} - // WebFrameClient ------------------------------------------------------------ WebPlugin* BrowserWebViewDelegate::createPlugin( @@ -670,7 +671,7 @@ void BrowserWebViewDelegate::didDisplayInsecureContent(WebFrame* frame) { } void BrowserWebViewDelegate::didRunInsecureContent( - WebFrame* frame, const WebString& security_origin) { + WebFrame* frame, const WebKit::WebSecurityOrigin& origin) { } void BrowserWebViewDelegate::didExhaustMemoryAvailableForScript(WebFrame* frame) { diff --git a/libcef/browser_webview_delegate.h b/libcef/browser_webview_delegate.h index 2c3c7f394..d6f636c40 100644 --- a/libcef/browser_webview_delegate.h +++ b/libcef/browser_webview_delegate.h @@ -21,7 +21,6 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/weak_ptr.h" -#include "webkit/api/public/WebEditingClient.h" #include "webkit/api/public/WebFrameClient.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webplugin_page_delegate.h" @@ -39,7 +38,6 @@ class GURL; class WebWidgetHost; class BrowserWebViewDelegate : public WebViewDelegate, - public WebKit::WebEditingClient, public WebKit::WebFrameClient, public webkit_glue::WebPluginPageDelegate, public base::SupportsWeakPtr { @@ -71,6 +69,28 @@ class BrowserWebViewDelegate : public WebViewDelegate, virtual void printPage(WebKit::WebFrame* frame); virtual void didStartLoading(); virtual void didStopLoading(); + virtual bool shouldBeginEditing(const WebKit::WebRange& range); + virtual bool shouldEndEditing(const WebKit::WebRange& range); + virtual bool shouldInsertNode( + const WebKit::WebNode& node, const WebKit::WebRange& range, + WebKit::WebEditingAction action); + virtual bool shouldInsertText( + const WebKit::WebString& text, const WebKit::WebRange& range, + WebKit::WebEditingAction action); + virtual bool shouldChangeSelectedRange( + const WebKit::WebRange& from, const WebKit::WebRange& to, + WebKit::WebTextAffinity affinity, bool still_selecting); + virtual bool shouldDeleteRange(const WebKit::WebRange& range); + virtual bool shouldApplyStyle( + const WebKit::WebString& style, const WebKit::WebRange& range); + virtual bool isSmartInsertDeleteEnabled(); + virtual bool isSelectTrailingWhitespaceEnabled(); + virtual void setInputMethodEnabled(bool enabled) {} + virtual void didBeginEditing(); + virtual void didChangeSelection(bool is_selection_empty); + virtual void didChangeContents(); + virtual void didExecuteCommand(const WebKit::WebString& command_name); + virtual void didEndEditing(); virtual void runModalAlertDialog( WebKit::WebFrame* frame, const WebKit::WebString& message); virtual bool runModalConfirmDialog( @@ -110,30 +130,6 @@ class BrowserWebViewDelegate : public WebViewDelegate, virtual WebKit::WebRect windowResizerRect(); virtual WebKit::WebScreenInfo screenInfo(); - // WebKit::WebEditingClient - virtual bool shouldBeginEditing(const WebKit::WebRange& range); - virtual bool shouldEndEditing(const WebKit::WebRange& range); - virtual bool shouldInsertNode( - const WebKit::WebNode& node, const WebKit::WebRange& range, - WebKit::WebEditingAction action); - virtual bool shouldInsertText( - const WebKit::WebString& text, const WebKit::WebRange& range, - WebKit::WebEditingAction action); - virtual bool shouldChangeSelectedRange( - const WebKit::WebRange& from, const WebKit::WebRange& to, - WebKit::WebTextAffinity affinity, bool still_selecting); - virtual bool shouldDeleteRange(const WebKit::WebRange& range); - virtual bool shouldApplyStyle( - const WebKit::WebString& style, const WebKit::WebRange& range); - virtual bool isSmartInsertDeleteEnabled(); - virtual bool isSelectTrailingWhitespaceEnabled(); - virtual void setInputMethodEnabled(bool enabled) {} - virtual void didBeginEditing(); - virtual void didChangeSelection(bool is_selection_empty); - virtual void didChangeContents(); - virtual void didExecuteCommand(const WebKit::WebString& command_name) {} - virtual void didEndEditing(); - // WebKit::WebFrameClient virtual WebKit::WebPlugin* createPlugin( WebKit::WebFrame*, const WebKit::WebPluginParams&); @@ -195,7 +191,7 @@ class BrowserWebViewDelegate : public WebViewDelegate, const WebKit::WebURLResponse&); virtual void didDisplayInsecureContent(WebKit::WebFrame* frame); virtual void didRunInsecureContent( - WebKit::WebFrame* frame, const WebKit::WebString& security_origin); + WebKit::WebFrame* frame, const WebKit::WebSecurityOrigin& origin); virtual void didExhaustMemoryAvailableForScript(WebKit::WebFrame*); virtual void didChangeContentsSize( WebKit::WebFrame*, const WebKit::WebSize&); diff --git a/libcef/webview_host.cc b/libcef/webview_host.cc index bce3fa70d..c3fff91f4 100644 --- a/libcef/webview_host.cc +++ b/libcef/webview_host.cc @@ -40,7 +40,7 @@ WebViewHost* WebViewHost::Create(HWND parent_view, GetModuleHandle(NULL), NULL); win_util::SetWindowUserData(host->view_, host); - host->webwidget_ = WebView::Create(delegate, delegate); + host->webwidget_ = WebView::Create(delegate); prefs.Apply(host->webview()); host->webview()->InitializeMainFrame(delegate); diff --git a/patch/patch.cfg b/patch/patch.cfg index 88957b87c..ad21d42fe 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -3,6 +3,4 @@ # file entry should be proceeded by the code review or bug report link that it # relates to. patches = { - # http://codereview.chromium.org/173107 - "webkit_glue_plugins" : "../../webkit/glue/plugins/" } diff --git a/patch/patches/webkit_glue_plugins.patch b/patch/patches/webkit_glue_plugins.patch deleted file mode 100644 index 9e19c5b89..000000000 --- a/patch/patches/webkit_glue_plugins.patch +++ /dev/null @@ -1,35 +0,0 @@ -Index: plugin_list.cc -=================================================================== ---- plugin_list.cc (revision 26359) -+++ plugin_list.cc (working copy) -@@ -141,6 +141,7 @@ - // other methods if they're called on other threads. - std::vector extra_plugin_paths; - std::vector extra_plugin_dirs; -+ std::vector internal_plugins; - { - AutoLock lock(lock_); - if (plugins_loaded_ && !refresh) -@@ -148,6 +149,7 @@ - - extra_plugin_paths = extra_plugin_paths_; - extra_plugin_dirs = extra_plugin_dirs_; -+ internal_plugins = internal_plugins_; - } - - base::TimeTicks start_time = base::TimeTicks::Now(); -@@ -157,6 +159,14 @@ - std::vector directories_to_scan; - GetPluginDirectories(&directories_to_scan); - -+ for (size_t i = 0; i < internal_plugins.size(); ++i) { -+#if defined(OS_WIN) -+ if (internal_plugins[i].path.value() == kDefaultPluginLibraryName) -+ continue; -+#endif -+ LoadPlugin(internal_plugins[i].path, &new_plugins); -+ } -+ - for (size_t i = 0; i < extra_plugin_paths.size(); ++i) - LoadPlugin(extra_plugin_paths[i], &new_plugins); -