Commit 2705f19c authored by Marshall Greenblatt's avatar Marshall Greenblatt

Windows: Fix loading of custom cursor resources (issue #692).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@778 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
parent b7656f50
......@@ -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': {
......
......@@ -3,6 +3,9 @@
// found in the LICENSE file.
#include "libcef/browser/content_browser_client.h"
#include <algorithm>
#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<size_t>(MAX_PATH), wstr.size());
wcsncpy(file_path, wstr.c_str(), count);
file_path[count] = 0;
}
return file_path;
}
#endif // defined(OS_WIN)
......@@ -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_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment