Commit aafec8e7 authored by James Forshaw's avatar James Forshaw Committed by Commit Bot

[Win] Statically link in uxtheme for Windows Native Theme.

This CL removes the dynamic linking of Vista-era APIs in preference to
static linking. To prevent the uxtheme DLL being loaded unnecessarily the
DLL is added marked as delay loaded.

Bug: 986625
Change-Id: I29987f493b7fdf92633b3ba4dde61573b5543bc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1720905Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: James Forshaw <forshaw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683176}
parent 66e44af1
...@@ -466,6 +466,7 @@ if (is_win) { ...@@ -466,6 +466,7 @@ if (is_win) {
"/DELAYLOAD:user32.dll", "/DELAYLOAD:user32.dll",
"/DELAYLOAD:userenv.dll", "/DELAYLOAD:userenv.dll",
"/DELAYLOAD:usp10.dll", "/DELAYLOAD:usp10.dll",
"/DELAYLOAD:uxtheme.dll",
"/DELAYLOAD:wer.dll", "/DELAYLOAD:wer.dll",
"/DELAYLOAD:wevtapi.dll", "/DELAYLOAD:wevtapi.dll",
"/DELAYLOAD:winhttp.dll", "/DELAYLOAD:winhttp.dll",
......
...@@ -83,6 +83,8 @@ if (is_win) { ...@@ -83,6 +83,8 @@ if (is_win) {
"//ui/display", "//ui/display",
"//ui/gfx", "//ui/gfx",
] ]
libs = [ "uxtheme.lib" ]
} }
} else { } else {
jumbo_source_set("native_theme_browser") { jumbo_source_set("native_theme_browser") {
......
This diff is collapsed.
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <map> #include <map>
#include <windows.h> #include <windows.h>
#include <uxtheme.h>
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -135,14 +134,6 @@ class NATIVE_THEME_EXPORT NativeThemeWin : public NativeTheme, ...@@ -135,14 +134,6 @@ class NATIVE_THEME_EXPORT NativeThemeWin : public NativeTheme,
const gfx::Rect& rect, const gfx::Rect& rect,
const ExtraParams& extra) const; const ExtraParams& extra) const;
HRESULT GetThemePartSize(ThemeName themeName,
HDC hdc,
int part_id,
int state_id,
RECT* rect,
int ts,
SIZE* size) const;
HRESULT PaintButton(HDC hdc, HRESULT PaintButton(HDC hdc,
State state, State state,
const ButtonExtraParams& extra, const ButtonExtraParams& extra,
...@@ -274,60 +265,6 @@ class NATIVE_THEME_EXPORT NativeThemeWin : public NativeTheme, ...@@ -274,60 +265,6 @@ class NATIVE_THEME_EXPORT NativeThemeWin : public NativeTheme,
void RegisterThemeRegkeyObserver(); void RegisterThemeRegkeyObserver();
void UpdateDarkModeStatus(); void UpdateDarkModeStatus();
typedef HRESULT (WINAPI* DrawThemeBackgroundPtr)(HANDLE theme,
HDC hdc,
int part_id,
int state_id,
const RECT* rect,
const RECT* clip_rect);
typedef HRESULT (WINAPI* DrawThemeBackgroundExPtr)(HANDLE theme,
HDC hdc,
int part_id,
int state_id,
const RECT* rect,
const DTBGOPTS* opts);
typedef HRESULT (WINAPI* GetThemeColorPtr)(HANDLE hTheme,
int part_id,
int state_id,
int prop_id,
COLORREF* color);
typedef HRESULT (WINAPI* GetThemeContentRectPtr)(HANDLE hTheme,
HDC hdc,
int part_id,
int state_id,
const RECT* rect,
RECT* content_rect);
typedef HRESULT (WINAPI* GetThemePartSizePtr)(HANDLE hTheme,
HDC hdc,
int part_id,
int state_id,
RECT* rect,
int ts,
SIZE* size);
typedef HANDLE (WINAPI* OpenThemeDataPtr)(HWND window,
LPCWSTR class_list);
typedef HRESULT (WINAPI* CloseThemeDataPtr)(HANDLE theme);
typedef void (WINAPI* SetThemeAppPropertiesPtr) (DWORD flags);
typedef BOOL (WINAPI* IsThemeActivePtr)();
typedef HRESULT (WINAPI* GetThemeIntPtr)(HANDLE hTheme,
int part_id,
int state_id,
int prop_id,
int *value);
// Function pointers into uxtheme.dll.
DrawThemeBackgroundPtr draw_theme_;
DrawThemeBackgroundExPtr draw_theme_ex_;
GetThemeColorPtr get_theme_color_;
GetThemeContentRectPtr get_theme_content_rect_;
GetThemePartSizePtr get_theme_part_size_;
OpenThemeDataPtr open_theme_;
CloseThemeDataPtr close_theme_;
// Handle to uxtheme.dll.
HMODULE theme_dll_;
// Dark Mode registry key. // Dark Mode registry key.
base::win::RegKey hkcu_themes_regkey_; base::win::RegKey hkcu_themes_regkey_;
......
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