Remove windows.h from shortcut.h
This allows shortcut.h to be included where Windows.h is not allowed
to be included.
Change-Id: I48547a23b331ff56ca56f8da264b6f3c8b81e03f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3416394
Reviewed-by: Jesse McKenna <jessemckenna@google.com>
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#964591}
diff --git a/base/win/shortcut.cc b/base/win/shortcut.cc
index e278356..73daa2b 100644
--- a/base/win/shortcut.cc
+++ b/base/win/shortcut.cc
@@ -60,6 +60,13 @@
ShortcutProperties::~ShortcutProperties() = default;
+void ShortcutProperties::set_description(const std::wstring& description_in) {
+ // Size restriction as per MSDN at http://goo.gl/OdNQq.
+ DCHECK_LE(description_in.size(), static_cast<size_t>(INFOTIPSIZE));
+ description = description_in;
+ options |= PROPERTIES_DESCRIPTION;
+}
+
bool CreateOrUpdateShortcutLink(const FilePath& shortcut_path,
const ShortcutProperties& properties,
ShortcutOperation operation) {
diff --git a/base/win/shortcut.h b/base/win/shortcut.h
index 5848ce2..d889821 100644
--- a/base/win/shortcut.h
+++ b/base/win/shortcut.h
@@ -5,8 +5,8 @@
#ifndef BASE_WIN_SHORTCUT_H_
#define BASE_WIN_SHORTCUT_H_
-#include <windows.h>
-#include <commctrl.h>
+#include "guiddef.h"
+
#include <stdint.h>
#include "base/base_export.h"
@@ -67,12 +67,7 @@
options |= PROPERTIES_ARGUMENTS;
}
- void set_description(const std::wstring& description_in) {
- // Size restriction as per MSDN at http://goo.gl/OdNQq.
- DCHECK_LE(description_in.size(), static_cast<size_t>(INFOTIPSIZE));
- description = description_in;
- options |= PROPERTIES_DESCRIPTION;
- }
+ void set_description(const std::wstring& description_in);
void set_icon(const FilePath& icon_in, int icon_index_in) {
icon = icon_in;