chore: remove unneeded conversions between wstring and u16string (#30047)

This commit is contained in:
Cheng Zhao 2021-07-12 13:33:26 +09:00 committed by GitHub
parent ccfde6c9d4
commit 21f6937728
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 63 additions and 66 deletions

View file

@ -17,6 +17,7 @@
#include <memory>
#include "base/logging.h"
#include "base/strings/string_util_win.h"
#include "shell/browser/notifications/win/win32_desktop_notifications/common.h"
#include "shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h"
@ -479,7 +480,8 @@ void DesktopNotificationController::Toast::Draw() {
SelectFont(hdc_, caption_font);
SetTextColor(hdc_, fore_color);
DrawText(hdc_, data_->caption.data(), (UINT)data_->caption.length(), &rc,
DrawText(hdc_, base::as_wcstr(data_->caption),
(UINT)data_->caption.length(), &rc,
DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX);
}
@ -490,8 +492,8 @@ void DesktopNotificationController::Toast::Draw() {
SelectFont(hdc_, body_font);
SetTextColor(hdc_, dimmed_color);
DrawText(hdc_, data_->body_text.data(), (UINT)data_->body_text.length(),
&rc,
DrawText(hdc_, base::as_wcstr(data_->body_text),
(UINT)data_->body_text.length(), &rc,
DT_LEFT | DT_WORDBREAK | DT_NOPREFIX | DT_END_ELLIPSIS |
DT_EDITCONTROL);
}