Fix implicit appUserModelId set
This commit is contained in:
parent
ab015e573b
commit
72464a6db5
2 changed files with 10 additions and 9 deletions
|
@ -325,8 +325,15 @@ Browser::LoginItemSettings Browser::GetLoginItemSettings(
|
||||||
|
|
||||||
PCWSTR Browser::GetAppUserModelID() {
|
PCWSTR Browser::GetAppUserModelID() {
|
||||||
if (app_user_model_id_.empty()) {
|
if (app_user_model_id_.empty()) {
|
||||||
SetAppUserModelID(base::ReplaceStringPlaceholders(
|
PWSTR current_app_id;
|
||||||
kAppUserModelIDFormat, base::UTF8ToUTF16(GetName()), nullptr));
|
if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(¤t_app_id))) {
|
||||||
|
app_user_model_id_ = currrent_app_id;
|
||||||
|
} else {
|
||||||
|
current_app_id = base::ReplaceStringPlaceholders(
|
||||||
|
kAppUserModelIDFormat, base::UTF8ToUTF16(GetName()), nullptr);
|
||||||
|
SetAppUserModelID(current_app_id);
|
||||||
|
}
|
||||||
|
CoTaskMemFree(current_app_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return app_user_model_id_.c_str();
|
return app_user_model_id_.c_str();
|
||||||
|
|
|
@ -32,13 +32,7 @@ namespace brightray {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
bool GetAppUserModelId(ScopedHString* app_id) {
|
bool GetAppUserModelId(ScopedHString* app_id) {
|
||||||
PWSTR current_app_id;
|
app_id->Reset(atom::api::Browser::Get()->GetAppUserModelID());
|
||||||
if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(¤t_app_id))) {
|
|
||||||
app_id->Reset(current_app_id);
|
|
||||||
CoTaskMemFree(current_app_id);
|
|
||||||
} else {
|
|
||||||
app_id->Reset(base::UTF8ToUTF16(GetApplicationName()));
|
|
||||||
}
|
|
||||||
return app_id->success();
|
return app_id->success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue