Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Unified Diff: base/win/win_util.cc

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/win/win_util.h ('k') | base/win/win_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/win_util.cc
diff --git a/base/win/win_util.cc b/base/win/win_util.cc
index a53f30a7caa61cd7dd0a10f3d72fe94cb310e185..f46242d3d252fc83fd4f7dd965fa6b3529335c41 100644
--- a/base/win/win_util.cc
+++ b/base/win/win_util.cc
@@ -119,19 +119,14 @@ namespace win {
static bool g_crash_on_process_detach = false;
-#define NONCLIENTMETRICS_SIZE_PRE_VISTA \
- SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER(NONCLIENTMETRICS, lfMessageFont)
-
-void GetNonClientMetrics(NONCLIENTMETRICS* metrics) {
+void GetNonClientMetrics(NONCLIENTMETRICS_XP* metrics) {
DCHECK(metrics);
-
- static const UINT SIZEOF_NONCLIENTMETRICS =
- (base::win::GetVersion() >= base::win::VERSION_VISTA) ?
- sizeof(NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA;
- metrics->cbSize = SIZEOF_NONCLIENTMETRICS;
- const bool success = !!SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
- SIZEOF_NONCLIENTMETRICS, metrics,
- 0);
+ metrics->cbSize = sizeof(*metrics);
+ const bool success = !!SystemParametersInfo(
+ SPI_GETNONCLIENTMETRICS,
+ metrics->cbSize,
+ reinterpret_cast<NONCLIENTMETRICS*>(metrics),
+ 0);
DCHECK(success);
}
« no previous file with comments | « base/win/win_util.h ('k') | base/win/win_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698