Use return value of GetProcessExecPath
This commit is contained in:
parent
1178915f30
commit
1b3d3b6b75
1 changed files with 7 additions and 7 deletions
|
@ -54,8 +54,8 @@ bool GetProcessExecPath(base::string16* exe) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetProtocolLaunchPath(mate::Arguments* args, base::string16* exe) {
|
bool GetProtocolLaunchPath(mate::Arguments* args, base::string16* exe) {
|
||||||
if (!args->GetNext(exe)) {
|
if (!args->GetNext(exe) && !GetProcessExecPath(exe)) {
|
||||||
GetProcessExecPath(exe);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read in optional args arg
|
// Read in optional args arg
|
||||||
|
@ -71,8 +71,8 @@ bool GetProtocolLaunchPath(mate::Arguments* args, base::string16* exe) {
|
||||||
|
|
||||||
bool FormatCommandLineString(base::string16* exe,
|
bool FormatCommandLineString(base::string16* exe,
|
||||||
const std::vector<base::string16>& launch_args) {
|
const std::vector<base::string16>& launch_args) {
|
||||||
if (exe->empty()) {
|
if (exe->empty() && !GetProcessExecPath(exe)) {
|
||||||
GetProcessExecPath(exe);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!launch_args.empty()) {
|
if (!launch_args.empty()) {
|
||||||
|
@ -278,9 +278,9 @@ void Browser::SetLoginItemSettings(LoginItemSettings settings) {
|
||||||
|
|
||||||
if (settings.open_at_login) {
|
if (settings.open_at_login) {
|
||||||
base::string16 exe = settings.path;
|
base::string16 exe = settings.path;
|
||||||
if (!FormatCommandLineString(&exe, settings.args)) return;
|
if (FormatCommandLineString(&exe, settings.args)) {
|
||||||
|
key.WriteValue(GetAppUserModelID(), exe.c_str());
|
||||||
key.WriteValue(GetAppUserModelID(), exe.c_str());
|
}
|
||||||
} else {
|
} else {
|
||||||
key.DeleteValue(GetAppUserModelID());
|
key.DeleteValue(GetAppUserModelID());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue