[go: nahoru, domu]

Changes to base to allow removing windows.h

Before we can remove includes of windows.h from header files we need to
_add_ includes of windows.h to .cc files that require it. This change
does this for source files in base. Usually this just involves adding
an include, but in a couple of places it involves moving an include of
windows.h - in those cases the code only compiles because a header file
include windows.h early enough.

This change also changes some calls to FindWindow/FindWindowEx to
FindWindowW/FindWindowExW so that we aren't dependent on the namespace
pollution macros.

This change also adds some defines and types to windows_types.h in order
to be ready for future changes that remove windows.h includes.

Bug: 796644
Change-Id: I2062adcecff8bfb91ce57194c31b6f58b6094484
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3016908
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#900116}
diff --git a/base/files/file_util.cc b/base/files/file_util.cc
index d2065ce..5b801a4 100644
--- a/base/files/file_util.cc
+++ b/base/files/file_util.cc
@@ -24,6 +24,10 @@
 #include "base/threading/scoped_blocking_call.h"
 #include "build/build_config.h"
 
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
 namespace base {
 
 #if !defined(OS_NACL_NONSFI)