alloy: win: Fix loading of some mouse cursors (fixes issue #3174)

This commit is contained in:
Alex Maitland 2021-09-22 09:17:27 +00:00 committed by Marshall Greenblatt
parent 0cee138670
commit 28599ae1a5
1 changed files with 18 additions and 0 deletions

View File

@ -49,6 +49,10 @@
#include "libcef/common/util_mac.h"
#endif
#if defined(OS_WIN)
#include "ui/base/resource/resource_bundle_win.h"
#endif
namespace {
const char* const kNonWildcardDomainNonPortSchemes[] = {
@ -492,6 +496,20 @@ void AlloyMainDelegate::InitializeResourceBundle() {
base::PathService::Override(ui::DIR_LOCALES, locales_dir);
}
#if defined(OS_WIN)
// From chrome/app/chrome_main_delegate.cc
// Throbber icons and cursors are still stored in chrome.dll,
// this can be killed once those are merged into resources.pak. See
// GlassBrowserFrameView::InitThrobberIcons(), https://crbug.com/368327 and
// https://crbug.com/1178117.
auto module_handle =
::GetModuleHandle(CefAppManager::Get()->GetResourceDllName());
if (!module_handle)
module_handle = ::GetModuleHandle(NULL);
ui::SetResourcesDataDLL(module_handle);
#endif
std::string locale = command_line->GetSwitchValueASCII(switches::kLang);
DCHECK(!locale.empty());