15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "chrome/browser/first_run/first_run_internal.h" 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include <windows.h> 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <shellapi.h> 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "base/base_paths.h" 112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/callback.h" 127dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "base/command_line.h" 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/file_util.h" 142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/files/file_path.h" 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/path_service.h" 16bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch#include "base/process/kill.h" 17bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch#include "base/process/launch.h" 18bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch#include "base/process/process.h" 192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/threading/sequenced_worker_pool.h" 20eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/time/time.h" 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/win/metro.h" 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/common/chrome_constants.h" 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/common/chrome_paths.h" 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/common/chrome_switches.h" 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/installer/util/google_update_settings.h" 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/installer/util/install_util.h" 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/installer/util/master_preferences.h" 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/installer/util/master_preferences_constants.h" 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/installer/util/util_constants.h" 302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "content/public/browser/browser_thread.h" 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "grit/locale_settings.h" 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/base/l10n/l10n_util.h" 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/base/win/shell.h" 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace { 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Launches the setup exe with the given parameter/value on the command-line. 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// For non-metro Windows, it waits for its termination, returns its exit code 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// in |*ret_code|, and returns true if the exit code is valid. 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// For metro Windows, it launches setup via ShellExecuteEx and returns in order 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// to bounce the user back to the desktop, then returns immediately. 422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)bool LaunchSetupForEula(const base::FilePath::StringType& value, 432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int* ret_code) { 442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::FilePath exe_dir; 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) if (!PathService::Get(base::DIR_MODULE, &exe_dir)) 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return false; 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) exe_dir = exe_dir.Append(installer::kInstallerDir); 482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::FilePath exe_path = exe_dir.Append(installer::kSetupExe); 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) base::ProcessHandle ph; 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) CommandLine cl(CommandLine::NO_PROGRAM); 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) cl.AppendSwitchNative(installer::switches::kShowEula, value); 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) CommandLine* browser_command_line = CommandLine::ForCurrentProcess(); 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) if (browser_command_line->HasSwitch(switches::kChromeFrame)) { 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) cl.AppendSwitch(switches::kChromeFrame); 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) if (base::win::IsMetroProcess()) { 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) cl.AppendSwitch(installer::switches::kShowEulaForMetro); 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // This obscure use of the 'log usage' mask for windows 8 is documented here 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // http://go.microsoft.com/fwlink/?LinkID=243079. It causes the desktop 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // process to receive focus. Pass SEE_MASK_FLAG_NO_UI to avoid hangs if an 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // error occurs since the UI can't be shown from a metro process. 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) ui::win::OpenAnyViaShell(exe_path.value(), 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) exe_dir.value(), 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) cl.GetCommandLineString(), 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) SEE_MASK_FLAG_LOG_USAGE | SEE_MASK_FLAG_NO_UI); 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return false; 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } else { 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) CommandLine setup_path(exe_path); 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) setup_path.AppendArguments(cl, false); 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 757dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch int exit_code = 0; 767dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch if (!base::LaunchProcess(setup_path, base::LaunchOptions(), &ph) || 777dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch !base::WaitForExitCode(ph, &exit_code)) { 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return false; 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *ret_code = exit_code; 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return true; 835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Populates |path| with the path to |file| in the sentinel directory. This is 872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// the application directory for user-level installs, and the default user data 882a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// dir for system-level installs. Returns false on error. 892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)bool GetSentinelFilePath(const wchar_t* file, base::FilePath* path) { 902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::FilePath exe_path; 912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) if (!PathService::Get(base::DIR_EXE, &exe_path)) 922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return false; 932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) if (InstallUtil::IsPerUserInstall(exe_path.value().c_str())) 942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) *path = exe_path; 952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) else if (!PathService::Get(chrome::DIR_USER_DATA, path)) 962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return false; 972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) *path = path->Append(file); 982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return true; 992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 1002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)bool GetEULASentinelFilePath(base::FilePath* path) { 1022a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return GetSentinelFilePath(installer::kEULASentinelFile, path); 1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns true if the EULA is required but has not been accepted by this user. 1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The EULA is considered having been accepted if the user has gotten past 1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// first run in the "other" environment (desktop or metro). 1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)bool IsEULANotAccepted(installer::MasterPreferences* install_prefs) { 1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool value = false; 1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) if (install_prefs->GetBool(installer::master_preferences::kRequireEula, 1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) &value) && value) { 1122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::FilePath eula_sentinel; 1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Be conservative and show the EULA if the path to the sentinel can't be 1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // determined. 1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) if (!GetEULASentinelFilePath(&eula_sentinel) || 1167dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch !base::PathExists(eula_sentinel)) { 1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return true; 1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return false; 1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Writes the EULA to a temporary file, returned in |*eula_path|, and returns 1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// true if successful. 1252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)bool WriteEULAtoTempFile(base::FilePath* eula_path) { 1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) std::string terms = l10n_util::GetStringUTF8(IDS_TERMS_HTML); 1277dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch return (!terms.empty() && 128a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) base::CreateTemporaryFile(eula_path) && 1297dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch file_util::WriteFile(*eula_path, terms.data(), terms.size()) != -1); 1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Creates the sentinel indicating that the EULA was required and has been 1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// accepted. 1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)bool CreateEULASentinel() { 1352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::FilePath eula_sentinel; 1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) if (!GetEULASentinelFilePath(&eula_sentinel)) 1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return false; 1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 139a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) return (base::CreateDirectory(eula_sentinel.DirName()) && 1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) file_util::WriteFile(eula_sentinel, "", 0) != -1); 1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace 1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace first_run { 1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace internal { 1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 148b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)void DoPostImportPlatformSpecificTasks(Profile* /* profile */) { 1492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Trigger the Active Setup command for system-level Chromes to finish 1502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // configuring this user's install (e.g. per-user shortcuts). 1512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Delay the task slightly to give Chrome launch I/O priority while also 1522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // making sure shortcuts are created promptly to avoid annoying the user by 1532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // re-creating shortcuts he previously deleted. 1542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) static const int64 kTiggerActiveSetupDelaySeconds = 5; 1552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::FilePath chrome_exe; 1562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { 1572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) NOTREACHED(); 1582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } else if (!InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())) { 1592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) content::BrowserThread::GetBlockingPool()->PostDelayedTask( 1602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) FROM_HERE, 1612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::Bind(&InstallUtil::TriggerActiveSetupCommand), 1622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::TimeDelta::FromSeconds(kTiggerActiveSetupDelaySeconds)); 1632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 1642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 1652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)bool GetFirstRunSentinelFilePath(base::FilePath* path) { 1672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return GetSentinelFilePath(chrome::kFirstRunSentinel, path); 1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs) { 1712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) if (IsEULANotAccepted(install_prefs)) { 1722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Show the post-installation EULA. This is done by setup.exe and the 1732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // result determines if we continue or not. We wait here until the user 1742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // dismisses the dialog. 1752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // The actual eula text is in a resource in chrome. We extract it to 1772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // a text file so setup.exe can use it as an inner frame. 1782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::FilePath inner_html; 1792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) if (WriteEULAtoTempFile(&inner_html)) { 1802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int retcode = 0; 1812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) if (!LaunchSetupForEula(inner_html.value(), &retcode) || 1822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) (retcode != installer::EULA_ACCEPTED && 1832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) retcode != installer::EULA_ACCEPTED_OPT_IN)) { 1842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) LOG(WARNING) << "EULA flow requires fast exit."; 1852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return false; 1862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 1872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) CreateEULASentinel(); 1882a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) if (retcode == installer::EULA_ACCEPTED) { 1902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) VLOG(1) << "EULA : no collection"; 1912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) GoogleUpdateSettings::SetCollectStatsConsent(false); 1922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } else if (retcode == installer::EULA_ACCEPTED_OPT_IN) { 1932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) VLOG(1) << "EULA : collection consent"; 1942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) GoogleUpdateSettings::SetCollectStatsConsent(true); 1952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 1962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 1972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 1982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return true; 1992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 2002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 201c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)base::FilePath MasterPrefsPath() { 202c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // The standard location of the master prefs is next to the chrome binary. 203c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) base::FilePath master_prefs; 204c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) if (!PathService::Get(base::DIR_EXE, &master_prefs)) 205c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) return base::FilePath(); 206c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); 207c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)} 208c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace internal 2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace first_run 211