Chromium Code Reviews| Index: chrome/browser/process_singleton_win.cc |
| =================================================================== |
| --- chrome/browser/process_singleton_win.cc (revision 160963) |
| +++ chrome/browser/process_singleton_win.cc (working copy) |
| @@ -26,6 +26,7 @@ |
| #include "chrome/common/chrome_constants.h" |
| #include "chrome/common/chrome_paths.h" |
| #include "chrome/common/chrome_paths_internal.h" |
| +#include "chrome/common/chrome_switches.h" |
| #include "chrome/installer/util/browser_distribution.h" |
| #include "chrome/installer/util/install_util.h" |
| #include "chrome/installer/util/shell_util.h" |
| @@ -201,16 +202,19 @@ |
| if (default_user_data_dir != user_data_dir) |
| return false; |
| + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUninstall)) |
|
gab
2012/10/11 01:55:48
I feel this is a special case hiding a bigger prob
|
| + return false; |
| + |
| base::win::RegKey reg_key; |
| LONG key_result = reg_key.Create(HKEY_CURRENT_USER, |
| chrome::kMetroRegistryPath, |
| KEY_READ); |
| if (key_result == ERROR_SUCCESS) { |
| DWORD reg_value = 0; |
| - reg_key.ReadValueDW(chrome::kLaunchModeValue, |
| - ®_value); |
| - if (reg_value == 1) |
| - return true; |
| + if (reg_key.ReadValueDW(chrome::kLaunchModeValue, ®_value) |
|
gab
2012/10/11 01:55:48
Isn't it simpler to have a single if for the logic
|
| + == ERROR_SUCCESS) { |
| + return reg_value == 1; |
| + } |
| } |
| return base::win::IsMachineATablet(); |
| } |