summaryrefslogtreecommitdiffstats
path: root/chromium/base/win/win_util.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-29 10:46:47 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-02 12:02:10 +0000
commit99677208ff3b216fdfec551fbe548da5520cd6fb (patch)
tree476a4865c10320249360e859d8fdd3e01833b03a /chromium/base/win/win_util.cc
parentc30a6232df03e1efbd9f3b226777b07e087a1122 (diff)
BASELINE: Update Chromium to 86.0.4240.124
Change-Id: Ide0ff151e94cd665ae6521a446995d34a9d1d644 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/base/win/win_util.cc')
-rw-r--r--chromium/base/win/win_util.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/chromium/base/win/win_util.cc b/chromium/base/win/win_util.cc
index 450c4ea3b17..6101564d773 100644
--- a/chromium/base/win/win_util.cc
+++ b/chromium/base/win/win_util.cc
@@ -78,7 +78,7 @@ bool SetPropVariantValueForPropertyStore(
// See third_party/perl/c/i686-w64-mingw32/include/propkey.h for GUID and
// PID definitions.
DPLOG(ERROR) << "Failed to set property with GUID "
- << String16FromGUID(property_key.fmtid) << " PID "
+ << WStringFromGUID(property_key.fmtid) << " PID "
<< property_key.pid;
#endif
return false;
@@ -340,10 +340,8 @@ bool IsKeyboardPresentOnSlate(HWND hwnd, std::string* reason) {
if (status == CR_SUCCESS) {
// To reduce the scope of the hack we only look for ACPI and HID\\VID
// prefixes in the keyboard device ids.
- if (StartsWith(AsStringPiece16(device_id), STRING16_LITERAL("ACPI"),
- CompareCase::INSENSITIVE_ASCII) ||
- StartsWith(AsStringPiece16(device_id), STRING16_LITERAL("HID\\VID"),
- CompareCase::INSENSITIVE_ASCII)) {
+ if (StartsWith(device_id, L"ACPI", CompareCase::INSENSITIVE_ASCII) ||
+ StartsWith(device_id, L"HID\\VID", CompareCase::INSENSITIVE_ASCII)) {
if (reason) {
*reason += "device: ";
*reason += WideToUTF8(device_id);
@@ -450,10 +448,11 @@ bool SetClsidForPropertyStore(IPropertyStore* property_store,
bool SetAppIdForPropertyStore(IPropertyStore* property_store,
const wchar_t* app_id) {
- // App id should be less than 64 chars and contain no space. And recommended
+ // App id should be less than 128 chars and contain no space. And recommended
// format is CompanyName.ProductName[.SubProduct.ProductNumber].
- // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx
- DCHECK_LT(lstrlen(app_id), 64);
+ // See
+ // https://docs.microsoft.com/en-us/windows/win32/shell/appids#how-to-form-an-application-defined-appusermodelid
+ DCHECK_LT(lstrlen(app_id), 128);
DCHECK_EQ(wcschr(app_id, L' '), nullptr);
return SetStringValueForPropertyStore(property_store, PKEY_AppUserModel_ID,
@@ -722,7 +721,7 @@ void EnableHighDPISupport() {
}
}
-string16 String16FromGUID(REFGUID rguid) {
+std::wstring WStringFromGUID(REFGUID rguid) {
// This constant counts the number of characters in the formatted string,
// including the null termination character.
constexpr int kGuidStringCharacters =
@@ -734,7 +733,7 @@ string16 String16FromGUID(REFGUID rguid) {
rguid.Data2, rguid.Data3, rguid.Data4[0], rguid.Data4[1], rguid.Data4[2],
rguid.Data4[3], rguid.Data4[4], rguid.Data4[5], rguid.Data4[6],
rguid.Data4[7])));
- return string16(as_u16cstr(guid_string), kGuidStringCharacters - 1);
+ return std::wstring(guid_string, kGuidStringCharacters - 1);
}
bool PinUser32(NativeLibraryLoadError* error) {