Chromium Code Reviews| Index: chrome/installer/util/shell_util.cc |
| diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc |
| index a753f802a160ddf145e294d92f9ec2bf4aed136b..37ecbcfcd38c06cc615ba9987796ddf8d0d2670a 100644 |
| --- a/chrome/installer/util/shell_util.cc |
| +++ b/chrome/installer/util/shell_util.cc |
| @@ -1307,10 +1307,10 @@ ShellUtil::DefaultState ProbeOpenCommandHandlers( |
| const base::FilePath& chrome_exe, |
| const wchar_t* const* protocols, |
| size_t num_protocols) { |
| - // Get its short (8.3) form. |
| - base::string16 short_app_path; |
| - if (!ShortNameFromPath(chrome_exe, &short_app_path)) |
| - return ShellUtil::UNKNOWN_DEFAULT; |
| + // Get its short (8.3) form if possible. |
| + base::string16 app_path; |
| + if (!ShortNameFromPath(chrome_exe, &app_path)) |
| + app_path = chrome_exe.value(); |
|
gab
2015/10/15 14:21:43
Value is only used inside if{} below, move it inli
Mark P
2015/10/15 16:27:48
I don't know what you mean. It's used in two spot
gab
2015/10/15 18:33:07
What I mean is you only need |short_app_path| in t
Mark P
2015/10/15 19:17:42
I don't understand. Do you mean that new line 133
gab
2015/10/16 19:02:17
I mean you definitely don't need it if you're not
Mark P
2015/10/16 23:02:44
Ah, now I understand.
|
| const HKEY root_key = HKEY_CLASSES_ROOT; |
| base::string16 key_path; |
| @@ -1330,11 +1330,14 @@ ShellUtil::DefaultState ProbeOpenCommandHandlers( |
| // Need to normalize path in case it's been munged. |
| command_line = base::CommandLine::FromString(value); |
| - if (!ShortNameFromPath(command_line.GetProgram(), &short_path)) |
| - return ShellUtil::UNKNOWN_DEFAULT; |
| - |
| - if (!base::FilePath::CompareEqualIgnoreCase(short_path, short_app_path)) |
| - return ShellUtil::NOT_DEFAULT; |
| + if (ShortNameFromPath(command_line.GetProgram(), &short_path)) { |
| + if (!base::FilePath::CompareEqualIgnoreCase(short_path, app_path)) |
|
gab
2015/10/15 14:21:43
Actually, @grt: shouldn't this entire method use P
grt (UTC plus 2)
2015/10/19 19:30:39
Might be a good idea, although the condition leadi
|
| + return ShellUtil::NOT_DEFAULT; |
| + } else { |
| + if (!base::FilePath::CompareEqualIgnoreCase( |
| + command_line.GetProgram().value(), app_path)) |
| + return ShellUtil::NOT_DEFAULT; |
| + } |
| } |
| return ShellUtil::IS_DEFAULT; |