- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kUserDataDir)) {
- path = command_line.GetSwitchValuePath(switches::kUserDataDir);
- } else {
- // Get the path from the same source as the installer, to make sure there
- // are no differences.
- BrowserDistribution* distribution =
- BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_BROWSER);
- installer::Product product(distribution);
- std::vector<base::FilePath> data_dir_paths;
- product.GetUserDataPaths(&data_dir_paths);
- if (!data_dir_paths.empty())
- path = data_dir_paths[0];
- }