diff --git a/cef3/cef.gyp b/cef3/cef.gyp index 8ef709e95..3feabbf46 100644 --- a/cef3/cef.gyp +++ b/cef3/cef.gyp @@ -460,6 +460,9 @@ }, 'sources': [ '<@(includes_win)', + # TODO(cef): Remove webkit_resources.rc once custom cursor resources + # can be loaded via ResourceBundle. See crbug.com/147663. + '$(OutDir)/obj/global_intermediate/webkit/webkit_resources.rc', 'libcef_dll/libcef_dll.rc', ], 'link_settings': { diff --git a/cef3/libcef/browser/content_browser_client.cc b/cef3/libcef/browser/content_browser_client.cc index 99c79a906..15a7d9335 100644 --- a/cef3/libcef/browser/content_browser_client.cc +++ b/cef3/libcef/browser/content_browser_client.cc @@ -3,6 +3,9 @@ // found in the LICENSE file. #include "libcef/browser/content_browser_client.h" + +#include + #include "libcef/browser/browser_context.h" #include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_main.h" @@ -15,6 +18,7 @@ #include "base/command_line.h" #include "base/file_path.h" +#include "base/path_service.h" #include "content/public/browser/access_token_store.h" #include "content/public/browser/media_observer.h" #include "content/public/browser/render_process_host.h" @@ -156,3 +160,21 @@ void CefContentBrowserClient::OverrideWebkitPrefs( std::string CefContentBrowserClient::GetDefaultDownloadName() { return "download"; } + +#if defined(OS_WIN) +const wchar_t* CefContentBrowserClient::GetResourceDllName() { + static wchar_t file_path[MAX_PATH+1] = {0}; + + if (file_path[0] == 0) { + // Retrieve the module path (usually libcef.dll). + FilePath module; + PathService::Get(base::FILE_MODULE, &module); + const std::wstring wstr = module.value(); + size_t count = std::min(static_cast(MAX_PATH), wstr.size()); + wcsncpy(file_path, wstr.c_str(), count); + file_path[count] = 0; + } + + return file_path; +} +#endif // defined(OS_WIN) diff --git a/cef3/libcef/browser/content_browser_client.h b/cef3/libcef/browser/content_browser_client.h index 7af9c92e5..84243d4c9 100644 --- a/cef3/libcef/browser/content_browser_client.h +++ b/cef3/libcef/browser/content_browser_client.h @@ -44,6 +44,9 @@ class CefContentBrowserClient : public content::ContentBrowserClient { const GURL& url, webkit_glue::WebPreferences* prefs) OVERRIDE; virtual std::string GetDefaultDownloadName() OVERRIDE; +#if defined(OS_WIN) + const wchar_t* GetResourceDllName() OVERRIDE; +#endif private: CefBrowserMainParts* browser_main_parts_;