|
@@ -14,6 +14,7 @@
|
|
|
#include <wrl\wrappers\corewrappers.h>
|
|
|
|
|
|
#include "base/environment.h"
|
|
|
+#include "base/hash/hash.h"
|
|
|
#include "base/logging.h"
|
|
|
#include "base/strings/strcat.h"
|
|
|
#include "base/strings/string_number_conversions.h"
|
|
@@ -71,6 +72,10 @@ void DebugLog(std::string_view log_msg) {
|
|
|
LOG(INFO) << log_msg;
|
|
|
}
|
|
|
|
|
|
+std::wstring GetTag(const std::string& notification_id) {
|
|
|
+ return base::NumberToWString(base::Hash(notification_id));
|
|
|
+}
|
|
|
+
|
|
|
} // namespace
|
|
|
|
|
|
// static
|
|
@@ -146,7 +151,7 @@ void WindowsToastNotification::Remove() {
|
|
|
return;
|
|
|
|
|
|
ScopedHString group(kGroup);
|
|
|
- ScopedHString tag(base::as_wcstr(base::UTF8ToUTF16(notification_id())));
|
|
|
+ ScopedHString tag(GetTag(notification_id()));
|
|
|
notification_history->RemoveGroupedTagWithId(tag, group, app_id);
|
|
|
}
|
|
|
|
|
@@ -199,7 +204,7 @@ HRESULT WindowsToastNotification::ShowInternal(
|
|
|
REPORT_AND_RETURN_IF_FAILED(toast2->put_Group(group),
|
|
|
"WinAPI: Setting group failed");
|
|
|
|
|
|
- ScopedHString tag(base::as_wcstr(base::UTF8ToUTF16(notification_id())));
|
|
|
+ ScopedHString tag(GetTag(notification_id()));
|
|
|
REPORT_AND_RETURN_IF_FAILED(toast2->put_Tag(tag),
|
|
|
"WinAPI: Setting tag failed");
|
|
|
|