2757472: Reland "Reland "[LSC] Remove base::string16 alias""

2757472
This commit is contained in:
John Kleinschmidt 2021-03-18 15:55:51 -04:00
parent 3b183854ff
commit 2d3c65beca
31 changed files with 200 additions and 152 deletions

View file

@ -15,6 +15,7 @@
#include "base/file_version_info.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
#include "base/strings/string_util_win.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "shell/browser/win/scoped_hstring.h"
@ -23,7 +24,7 @@ namespace electron {
namespace {
std::u16string g_app_user_model_id;
std::wstring g_app_user_model_id;
}
const wchar_t kAppUserModelIDFormat[] = L"electron.app.$1";
@ -42,7 +43,7 @@ std::string GetApplicationVersion() {
return base::UTF16ToUTF8(info->product_version());
}
void SetAppUserModelID(const std::u16string& name) {
void SetAppUserModelID(const std::wstring& name) {
g_app_user_model_id = name;
SetCurrentProcessExplicitAppUserModelID(g_app_user_model_id.c_str());
}
@ -54,8 +55,8 @@ PCWSTR GetRawAppUserModelID() {
g_app_user_model_id = current_app_id;
} else {
std::string name = GetApplicationName();
std::u16string generated_app_id = base::ReplaceStringPlaceholders(
kAppUserModelIDFormat, base::UTF8ToUTF16(name), nullptr);
std::wstring generated_app_id = base::ReplaceStringPlaceholders(
kAppUserModelIDFormat, {base::UTF8ToWide(name)}, nullptr);
SetAppUserModelID(generated_app_id);
}
CoTaskMemFree(current_app_id);