diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 5e1ca4d4d..2d08270bb 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -34,3 +34,4 @@ Date | CEF Revision | Chromium Revision 2009-06-02 | /trunk@28 | /trunk@17397 2009-07-24 | /trunk@32 | /trunk@21529 2009-08-13 | /trunk@34 | /trunk@23266 +2009-08-20 | /trunk@35 | /trunk@23814 diff --git a/libcef/browser_impl_win.cc b/libcef/browser_impl_win.cc index 17003d22c..5760076cc 100644 --- a/libcef/browser_impl_win.cc +++ b/libcef/browser_impl_win.cc @@ -9,7 +9,6 @@ #include "browser_webkit_glue.h" #include "stream_impl.h" #include "printing/units.h" -#include "../patch/patch_state.h" #include "base/string_util.h" #include "base/win_util.h" @@ -428,11 +427,6 @@ void CefBrowserImpl::UIT_CanGoForwardNotify(bool *retVal, HANDLE hEvent) void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages, const gfx::Size& canvas_size, WebKit::WebFrame* frame) { -#if !CEF_PATCHES_APPLIED - NOTREACHED() << "CEF patches must be applied to support printing."; - return; -#endif // !CEF_PATCHES_APPLIED - REQUIRE_UIT(); printing::PrintParams params; @@ -473,10 +467,7 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages, canvas.clipRect(clip_rect); // Apply the WebKit scaling factor. - float webkit_scale = 0; -#if CEF_PATCHES_APPLIED - webkit_scale = frame->getPrintPageShrink(page_number); -#endif // CEF_PATCHES_APPLIED + float webkit_scale = frame->getPrintPageShrink(page_number); if (webkit_scale <= 0) { NOTREACHED() << "Printing page " << page_number << " failed."; } @@ -577,11 +568,6 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages, } void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) { -#if !CEF_PATCHES_APPLIED - NOTREACHED() << "CEF patches must be applied to support printing."; - return; -#endif // !CEF_PATCHES_APPLIED - REQUIRE_UIT(); TCHAR printername[512]; diff --git a/libcef/browser_request_context.cc b/libcef/browser_request_context.cc index 0a43dbaf8..52c2f5a85 100644 --- a/libcef/browser_request_context.cc +++ b/libcef/browser_request_context.cc @@ -6,8 +6,15 @@ #include "precompiled_libcef.h" #include "browser_request_context.h" +#include "build/build_config.h" + #include "net/base/cookie_monster.h" #include "net/base/host_resolver.h" +#if defined(OS_WIN) +#include "net/base/ssl_config_service_win.h" +#else +#include "net/base/ssl_config_service_defaults.h" +#endif #include "net/ftp/ftp_network_layer.h" #include "net/proxy/proxy_service.h" #include "webkit/glue/webkit_glue.h" @@ -37,12 +44,19 @@ void BrowserRequestContext::Init( host_resolver_ = net::CreateSystemHostResolver(); proxy_service_ = net::ProxyService::Create(no_proxy ? &proxy_config : NULL, false, NULL, NULL); +#if defined(OS_WIN) + ssl_config_service_ = new net::SSLConfigServiceWin; +#else + ssl_config_service_ = new net::SSLConfigServiceDefaults; +#endif net::HttpCache *cache; if (cache_path.empty()) { - cache = new net::HttpCache(host_resolver_, proxy_service_, 0); + cache = new net::HttpCache(host_resolver_, proxy_service_, + ssl_config_service_, 0); } else { - cache = new net::HttpCache(host_resolver_, proxy_service_, cache_path, 0); + cache = new net::HttpCache(host_resolver_, proxy_service_, + ssl_config_service_, cache_path, 0); } cache->set_mode(cache_mode); http_transaction_factory_ = cache; @@ -54,7 +68,6 @@ BrowserRequestContext::~BrowserRequestContext() { delete cookie_store_; delete ftp_transaction_factory_; delete http_transaction_factory_; - delete proxy_service_; } const std::string& BrowserRequestContext::GetUserAgent( diff --git a/libcef/browser_resource_loader_bridge.cc b/libcef/browser_resource_loader_bridge.cc index 61588513c..b87089db7 100644 --- a/libcef/browser_resource_loader_bridge.cc +++ b/libcef/browser_resource_loader_bridge.cc @@ -748,7 +748,7 @@ bool FindProxyForUrl(const GURL& url, std::string* proxy_list) { request_context->proxy_service())); net::ProxyInfo proxy_info; - int rv = sync_proxy_service->ResolveProxy(NULL, url, &proxy_info); + int rv = sync_proxy_service->ResolveProxy(url, &proxy_info, NULL); if (rv == net::OK) { *proxy_list = proxy_info.ToPacString(); } diff --git a/libcef/browser_webkit_glue.cc b/libcef/browser_webkit_glue.cc index c52dfebaf..a4352cff4 100644 --- a/libcef/browser_webkit_glue.cc +++ b/libcef/browser_webkit_glue.cc @@ -8,6 +8,7 @@ #include "base/compiler_specific.h" #include "base/logging.h" +#undef LOG #include "config.h" MSVC_PUSH_WARNING_LEVEL(0); #include "TextEncoding.h" @@ -16,7 +17,6 @@ MSVC_POP_WARNING(); #include "browser_webkit_glue.h" -#undef LOG #include "base/path_service.h" #include "base/resource_util.h" #include "base/scoped_ptr.h" @@ -132,8 +132,10 @@ StringPiece GetDataResource(int resource_id) { case IDR_SEARCH_MAGNIFIER_RESULTS: case IDR_MEDIA_PAUSE_BUTTON: case IDR_MEDIA_PLAY_BUTTON: + case IDR_MEDIA_PLAY_BUTTON_DISABLED: case IDR_MEDIA_SOUND_FULL_BUTTON: case IDR_MEDIA_SOUND_NONE_BUTTON: + case IDR_MEDIA_SOUND_DISABLED: case IDR_MEDIA_SLIDER_THUMB: return NetResourceProvider(resource_id); default: diff --git a/libcef/browser_webkit_glue_win.cc b/libcef/browser_webkit_glue_win.cc index 8f7ffc49a..d8f80dbf3 100644 --- a/libcef/browser_webkit_glue_win.cc +++ b/libcef/browser_webkit_glue_win.cc @@ -50,9 +50,8 @@ HCURSOR LoadCursor(int cursor_id) { return NULL; } -bool GetPlugins(bool refresh, std::vector* plugins) { +void GetPlugins(bool refresh, std::vector* plugins) { NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins); - return true; } bool EnsureFontLoaded(HFONT font) { diff --git a/libcef/browser_webview_delegate.cc b/libcef/browser_webview_delegate.cc index 96a6dad28..446433074 100644 --- a/libcef/browser_webview_delegate.cc +++ b/libcef/browser_webview_delegate.cc @@ -9,6 +9,7 @@ #include "precompiled_libcef.h" #include "config.h" +#undef LOG #include "browser_webview_delegate.h" #include "browser_impl.h" #include "browser_navigation_controller.h" @@ -583,14 +584,14 @@ void BrowserWebViewDelegate::TakeFocus(WebView* webview, bool reverse) { void BrowserWebViewDelegate::SetUserStyleSheetEnabled(bool is_enabled) { WebPreferences* prefs = _Context->GetWebPreferences(); prefs->user_style_sheet_enabled = is_enabled; - browser_->GetWebView()->SetPreferences(*prefs); + prefs->Apply(browser_->GetWebView()); } void BrowserWebViewDelegate::SetUserStyleSheetLocation(const GURL& location) { WebPreferences* prefs = _Context->GetWebPreferences(); prefs->user_style_sheet_enabled = true; prefs->user_style_sheet_location = location; - browser_->GetWebView()->SetPreferences(*prefs); + prefs->Apply(browser_->GetWebView()); } void BrowserWebViewDelegate::SetSmartInsertDeleteEnabled(bool enabled) { diff --git a/libcef/context.cc b/libcef/context.cc index 2e9339cbd..6f31e8c7b 100644 --- a/libcef/context.cc +++ b/libcef/context.cc @@ -138,8 +138,7 @@ void CefContext::UIT_RegisterPlugin(struct CefPluginInfo* plugin_info) 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)); + NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); delete plugin_info; } diff --git a/libcef/webview_host.cc b/libcef/webview_host.cc index 0a599ee5c..4d59d4b19 100644 --- a/libcef/webview_host.cc +++ b/libcef/webview_host.cc @@ -9,6 +9,7 @@ #include "base/gfx/rect.h" #include "base/gfx/size.h" #include "base/win_util.h" +#include "webkit/glue/webpreferences.h" #include "webkit/glue/webview.h" static const wchar_t kWindowClassName[] = L"WebViewHost"; @@ -38,7 +39,9 @@ WebViewHost* WebViewHost::Create(HWND parent_view, GetModuleHandle(NULL), NULL); win_util::SetWindowUserData(host->view_, host); - host->webwidget_ = WebView::Create(delegate, prefs); + host->webwidget_ = WebView::Create(); + prefs.Apply(host->webview()); + host->webview()->InitializeMainFrame(delegate); return host; } diff --git a/patch/patch.cfg b/patch/patch.cfg index a63159a56..88957b87c 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -3,7 +3,6 @@ # file entry should be proceeded by the code review or bug report link that it # relates to. patches = { - # http://codereview.chromium.org/164482 - "webkit_api" : "../../webkit/api/", - "webkit_glue" : "../../webkit/glue/" + # http://codereview.chromium.org/173107 + "webkit_glue_plugins" : "../../webkit/glue/plugins/" } diff --git a/patch/patches/webkit_api.patch b/patch/patches/webkit_api.patch deleted file mode 100644 index f85fb4eb8..000000000 --- a/patch/patches/webkit_api.patch +++ /dev/null @@ -1,16 +0,0 @@ -Index: public/WebFrame.h -=================================================================== ---- public/WebFrame.h (revision 23266) -+++ public/WebFrame.h (working copy) -@@ -332,6 +332,11 @@ - // given page size. - virtual int printBegin(const WebSize& pageSize) = 0; - -+ // Returns the page shrinking factor calculated by webkit (usually -+ // between 1/1.25 and 1/2). Returns 0 if the page number is invalid or -+ // not in printing mode. -+ virtual float getPrintPageShrink(int page) = 0; -+ - // Prints one page, and returns the calculated page shrinking factor - // (usually between 1/1.25 and 1/2). Returns 0 if the page number is - // invalid or not in printing mode. diff --git a/patch/patches/webkit_glue.patch b/patch/patches/webkit_glue.patch deleted file mode 100644 index cd8f0aae8..000000000 --- a/patch/patches/webkit_glue.patch +++ /dev/null @@ -1,33 +0,0 @@ -Index: webframe_impl.cc -=================================================================== ---- webframe_impl.cc (revision 23266) -+++ webframe_impl.cc (working copy) -@@ -1045,6 +1045,16 @@ - return print_context_->pageCount(); - } - -+float WebFrameImpl::getPrintPageShrink(int page) { -+ // Ensure correct state. -+ if (!print_context_.get() || page < 0) { -+ NOTREACHED(); -+ return 0; -+ } -+ -+ return print_context_->getPageShrink(page); -+} -+ - float WebFrameImpl::printPage(int page, WebCanvas* canvas) { - // Ensure correct state. - if (!print_context_.get() || page < 0 || !frame() || !frame()->document()) { -Index: webframe_impl.h -=================================================================== ---- webframe_impl.h (revision 23266) -+++ webframe_impl.h (working copy) -@@ -147,6 +147,7 @@ - virtual WebKit::WebString selectionAsMarkup() const; - virtual int printBegin(const WebKit::WebSize& page_size); - virtual float printPage(int page_to_print, WebKit::WebCanvas* canvas); -+ virtual float getPrintPageShrink(int page); - virtual void printEnd(); - virtual bool find( - int identifier, const WebKit::WebString& search_text, diff --git a/patch/patches/webkit_glue_plugins.patch b/patch/patches/webkit_glue_plugins.patch new file mode 100644 index 000000000..e705b3587 --- /dev/null +++ b/patch/patches/webkit_glue_plugins.patch @@ -0,0 +1,37 @@ +Index: plugin_list.cc +=================================================================== +--- plugin_list.cc (revision 23814) ++++ plugin_list.cc (working copy) +@@ -50,7 +50,7 @@ + + void PluginList::RegisterInternalPlugin(const PluginVersionInfo& info) { + AutoLock lock(lock_); +- internal_plugins_.push_back(info); ++ internal_plugins_.insert(internal_plugins_.begin(), info); + } + + bool PluginList::ReadPluginInfo(const FilePath &filename, +Index: plugin_list_win.cc +=================================================================== +--- plugin_list_win.cc (revision 23814) ++++ plugin_list_win.cc (working copy) +@@ -356,10 +356,15 @@ + } + + void PluginList::LoadInternalPlugins(std::vector* plugins) { +- if (!use_internal_activex_shim_) +- return; +- LoadPlugin(FilePath(kActiveXShimFileName), plugins); +- LoadPlugin(FilePath(kActiveXShimFileNameForMediaPlayer), plugins); ++ for (size_t i = 0; i < internal_plugins_.size(); ++i) { ++ if (!use_internal_activex_shim_ && ++ (internal_plugins_[i].path.value() == kActiveXShimFileName || ++ internal_plugins_[i].path.value() == ++ kActiveXShimFileNameForMediaPlayer)) { ++ continue; ++ } ++ LoadPlugin(internal_plugins_[i].path, plugins); ++ } + } + + } // namespace NPAPI