Merge revision 778 changes:

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

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1180@779 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-09-10 22:32:56 +00:00
parent b15a5ac9ac
commit 933bb1a70b
3 changed files with 28 additions and 0 deletions

View File

@@ -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': {

View File

@@ -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)

View File

@@ -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_;