summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-10 03:41:45 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-10 03:41:45 +0000
commit650b2d5cdcab7d2c473c00d15b9f343f3a3405bb (patch)
tree1343ea25d7d6086ac1279e1e0e32562b3b9b3477 /chrome/browser/first_run
parent6f3638708ff440a2e80662ce49acc41cdad51ecd (diff)
downloadchromium_src-650b2d5cdcab7d2c473c00d15b9f343f3a3405bb.zip
chromium_src-650b2d5cdcab7d2c473c00d15b9f343f3a3405bb.tar.gz
chromium_src-650b2d5cdcab7d2c473c00d15b9f343f3a3405bb.tar.bz2
Merge branch 'master' into file_path_browser
version control markers Merge branch 'master' into file_path_browser remove version control Fix typo Merge branch 'master' into file_path_browser Conflicts: chrome/browser/intents/native_services_browsertest.cc chrome/browser/ui/intents/native_file_picker_service.cc Merge branch 'master' into file_path_browser Conflicts: chrome/browser/chromeos/drive/drive_file_system.cc chrome/browser/chromeos/drive/drive_file_system.h chrome/browser/chromeos/drive/drive_file_system_interface.h chrome/browser/chromeos/drive/drive_file_system_unittest.cc chrome/browser/chromeos/drive/file_system/drive_operations.cc chrome/browser/chromeos/login/wallpaper_manager.cc chrome/browser/chromeos/login/wallpaper_manager.h chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc chrome/browser/google_apis/gdata_wapi_operations.cc chrome/browser/google_apis/gdata_wapi_operations.h chrome/browser/google_apis/gdata_wapi_operations_unittest.cc chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.h chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.h chrome/browser/profiles/profile_impl_io_data.cc chrome/browser/profiles/profile_impl_io_data.h chrome/browser/sync_file_system/drive_file_sync_client_unittest.cc chrome/browser/ui/webui/options/manage_profile_handler.cc Long lines long lines some long lines. long lines long lines Beginning of lines. Rename FilePath -> base::FilePath in chrome/browser git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181638 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run')
-rw-r--r--chrome/browser/first_run/first_run.cc40
-rw-r--r--chrome/browser/first_run/first_run_browsertest.cc2
-rw-r--r--chrome/browser/first_run/first_run_linux.cc8
-rw-r--r--chrome/browser/first_run/first_run_mac.mm4
-rw-r--r--chrome/browser/first_run/first_run_posix.cc6
-rw-r--r--chrome/browser/first_run/first_run_unittest.cc2
-rw-r--r--chrome/browser/first_run/first_run_win.cc43
-rw-r--r--chrome/browser/first_run/upgrade_util_linux.cc4
-rw-r--r--chrome/browser/first_run/upgrade_util_win.cc16
9 files changed, 64 insertions, 61 deletions
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index 059112d..39eb69a 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -118,14 +118,14 @@ void DoDelayedInstallExtensionsIfNeeded(
}
}
-FilePath GetDefaultPrefFilePath(bool create_profile_dir,
- const FilePath& user_data_dir) {
- FilePath default_pref_dir =
+base::FilePath GetDefaultPrefFilePath(bool create_profile_dir,
+ const base::FilePath& user_data_dir) {
+ base::FilePath default_pref_dir =
ProfileManager::GetDefaultProfileDir(user_data_dir);
if (create_profile_dir) {
if (!file_util::PathExists(default_pref_dir)) {
if (!file_util::CreateDirectory(default_pref_dir))
- return FilePath();
+ return base::FilePath();
}
}
return ProfileManager::GetProfilePrefsPath(default_pref_dir);
@@ -184,7 +184,8 @@ void SetImportItem(PrefService* user_prefs,
// Imports bookmarks from an html file. The path to the file is provided in
// the command line.
int ImportFromFile(Profile* profile, const CommandLine& cmdline) {
- FilePath file_path = cmdline.GetSwitchValuePath(switches::kImportFromFile);
+ base::FilePath file_path =
+ cmdline.GetSwitchValuePath(switches::kImportFromFile);
if (file_path.empty()) {
NOTREACHED();
return false;
@@ -215,14 +216,15 @@ namespace internal {
FirstRunState first_run_ = FIRST_RUN_UNKNOWN;
-static base::LazyInstance<FilePath> master_prefs_path_for_testing
+static base::LazyInstance<base::FilePath> master_prefs_path_for_testing
= LAZY_INSTANCE_INITIALIZER;
-installer::MasterPreferences* LoadMasterPrefs(FilePath* master_prefs_path) {
+installer::MasterPreferences*
+ LoadMasterPrefs(base::FilePath* master_prefs_path) {
if (!master_prefs_path_for_testing.Get().empty())
*master_prefs_path = master_prefs_path_for_testing.Get();
else
- *master_prefs_path = FilePath(MasterPrefsPath());
+ *master_prefs_path = base::FilePath(MasterPrefsPath());
if (master_prefs_path->empty())
return NULL;
installer::MasterPreferences* install_prefs =
@@ -235,9 +237,9 @@ installer::MasterPreferences* LoadMasterPrefs(FilePath* master_prefs_path) {
return install_prefs;
}
-bool CopyPrefFile(const FilePath& user_data_dir,
- const FilePath& master_prefs_path) {
- FilePath user_prefs = GetDefaultPrefFilePath(true, user_data_dir);
+bool CopyPrefFile(const base::FilePath& user_data_dir,
+ const base::FilePath& master_prefs_path) {
+ base::FilePath user_prefs = GetDefaultPrefFilePath(true, user_data_dir);
if (user_prefs.empty())
return false;
@@ -385,7 +387,7 @@ bool IsChromeFirstRun() {
if (internal::first_run_ != internal::FIRST_RUN_UNKNOWN)
return internal::first_run_ == internal::FIRST_RUN_TRUE;
- FilePath first_run_sentinel;
+ base::FilePath first_run_sentinel;
if (!internal::GetFirstRunSentinelFilePath(&first_run_sentinel) ||
file_util::PathExists(first_run_sentinel)) {
internal::first_run_ = internal::FIRST_RUN_FALSE;
@@ -396,7 +398,7 @@ bool IsChromeFirstRun() {
}
bool CreateSentinel() {
- FilePath first_run_sentinel;
+ base::FilePath first_run_sentinel;
if (!internal::GetFirstRunSentinelFilePath(&first_run_sentinel))
return false;
return file_util::WriteFile(first_run_sentinel, "", 0) != -1;
@@ -415,7 +417,7 @@ void RegisterUserPrefs(PrefServiceSyncable* prefs) {
}
bool RemoveSentinel() {
- FilePath first_run_sentinel;
+ base::FilePath first_run_sentinel;
if (!internal::GetFirstRunSentinelFilePath(&first_run_sentinel))
return false;
return file_util::Delete(first_run_sentinel, false);
@@ -558,12 +560,12 @@ void FirstRunBubbleLauncher::Observe(
delete this;
}
-void SetMasterPrefsPathForTesting(const FilePath& master_prefs) {
+void SetMasterPrefsPathForTesting(const base::FilePath& master_prefs) {
internal::master_prefs_path_for_testing.Get() = master_prefs;
}
ProcessMasterPreferencesResult ProcessMasterPreferences(
- const FilePath& user_data_dir,
+ const base::FilePath& user_data_dir,
MasterPrefs* out_prefs) {
DCHECK(!user_data_dir.empty());
@@ -574,7 +576,7 @@ ProcessMasterPreferencesResult ProcessMasterPreferences(
return SKIP_FIRST_RUN_TASKS;
#endif
- FilePath master_prefs_path;
+ base::FilePath master_prefs_path;
scoped_ptr<installer::MasterPreferences>
install_prefs(internal::LoadMasterPrefs(&master_prefs_path));
if (!install_prefs.get())
@@ -626,7 +628,7 @@ void AutoImport(
importer_host = new ImporterHost;
#endif
- FilePath local_state_path;
+ base::FilePath local_state_path;
PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path);
bool local_state_file_exists = file_util::PathExists(local_state_path);
@@ -701,7 +703,7 @@ void DoPostImportTasks(Profile* profile, bool make_chrome_default) {
}
#if !defined(USE_AURA)
- FilePath local_state_path;
+ base::FilePath local_state_path;
PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path);
bool local_state_file_exists = file_util::PathExists(local_state_path);
diff --git a/chrome/browser/first_run/first_run_browsertest.cc b/chrome/browser/first_run/first_run_browsertest.cc
index 3f0e3c6..63e880f 100644
--- a/chrome/browser/first_run/first_run_browsertest.cc
+++ b/chrome/browser/first_run/first_run_browsertest.cc
@@ -117,7 +117,7 @@ class FirstRunMasterPrefsBrowserTest : public FirstRunIntegrationBrowserTest {
}
private:
- FilePath prefs_file_;
+ base::FilePath prefs_file_;
DISALLOW_COPY_AND_ASSIGN(FirstRunMasterPrefsBrowserTest);
};
diff --git a/chrome/browser/first_run/first_run_linux.cc b/chrome/browser/first_run/first_run_linux.cc
index f32ba78..c1a2c9d 100644
--- a/chrome/browser/first_run/first_run_linux.cc
+++ b/chrome/browser/first_run/first_run_linux.cc
@@ -34,7 +34,7 @@ bool IsOrganicFirstRun() {
// TODO(port): This is just a piece of the silent import functionality from
// ImportSettings for Windows. It would be nice to get the rest of it ported.
-bool ImportBookmarks(const FilePath& import_bookmarks_path) {
+bool ImportBookmarks(const base::FilePath& import_bookmarks_path) {
const CommandLine& cmdline = *CommandLine::ForCurrentProcess();
CommandLine import_cmd(cmdline.GetProgram());
@@ -68,11 +68,11 @@ bool ImportBookmarks(const FilePath& import_bookmarks_path) {
namespace first_run {
-FilePath MasterPrefsPath() {
+base::FilePath MasterPrefsPath() {
// The standard location of the master prefs is next to the chrome binary.
- FilePath master_prefs;
+ base::FilePath master_prefs;
if (!PathService::Get(base::DIR_EXE, &master_prefs))
- return FilePath();
+ return base::FilePath();
return master_prefs.AppendASCII(installer::kDefaultMasterPrefs);
}
diff --git a/chrome/browser/first_run/first_run_mac.mm b/chrome/browser/first_run/first_run_mac.mm
index 27c82d9..c4d2730 100644
--- a/chrome/browser/first_run/first_run_mac.mm
+++ b/chrome/browser/first_run/first_run_mac.mm
@@ -15,7 +15,7 @@
namespace first_run {
namespace internal {
-bool ImportBookmarks(const FilePath& import_bookmarks_path) {
+bool ImportBookmarks(const base::FilePath& import_bookmarks_path) {
// http://crbug.com/48880
return false;
}
@@ -25,7 +25,7 @@ bool ImportBookmarks(const FilePath& import_bookmarks_path) {
namespace first_run {
-FilePath MasterPrefsPath() {
+base::FilePath MasterPrefsPath() {
return master_prefs::MasterPrefsPath();
}
diff --git a/chrome/browser/first_run/first_run_posix.cc b/chrome/browser/first_run/first_run_posix.cc
index 4b3fae1..57e8f34 100644
--- a/chrome/browser/first_run/first_run_posix.cc
+++ b/chrome/browser/first_run/first_run_posix.cc
@@ -77,8 +77,8 @@ void DoPostImportPlatformSpecificTasks() {
#endif
}
-bool GetFirstRunSentinelFilePath(FilePath* path) {
- FilePath first_run_sentinel;
+bool GetFirstRunSentinelFilePath(base::FilePath* path) {
+ base::FilePath first_run_sentinel;
if (!PathService::Get(chrome::DIR_USER_DATA, &first_run_sentinel))
return false;
@@ -126,7 +126,7 @@ void SetImportPreferencesAndLaunchImport(
&import_bookmarks_path);
if (!import_bookmarks_path.empty()) {
// There are bookmarks to import from a file.
- FilePath path = FilePath::FromWStringHack(UTF8ToWide(
+ base::FilePath path = base::FilePath::FromWStringHack(UTF8ToWide(
import_bookmarks_path));
if (!ImportBookmarks(path)) {
LOG(WARNING) << "silent bookmark import failed";
diff --git a/chrome/browser/first_run/first_run_unittest.cc b/chrome/browser/first_run/first_run_unittest.cc
index 4d1a566..70834a0 100644
--- a/chrome/browser/first_run/first_run_unittest.cc
+++ b/chrome/browser/first_run/first_run_unittest.cc
@@ -21,7 +21,7 @@ class FirstRunTest : public testing::Test {
first_run::internal::GetFirstRunSentinelFilePath(&sentinel_path_);
}
- FilePath sentinel_path_;
+ base::FilePath sentinel_path_;
private:
base::ScopedPathOverride user_data_dir_override_;
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index 5270ce4..f04f4bf 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -66,12 +66,13 @@ namespace {
// in |*ret_code|, and returns true if the exit code is valid.
// For metro Windows, it launches setup via ShellExecuteEx and returns in order
// to bounce the user back to the desktop, then returns immediately.
-bool LaunchSetupForEula(const FilePath::StringType& value, int* ret_code) {
- FilePath exe_dir;
+bool LaunchSetupForEula(const base::FilePath::StringType& value,
+ int* ret_code) {
+ base::FilePath exe_dir;
if (!PathService::Get(base::DIR_MODULE, &exe_dir))
return false;
exe_dir = exe_dir.Append(installer::kInstallerDir);
- FilePath exe_path = exe_dir.Append(installer::kSetupExe);
+ base::FilePath exe_path = exe_dir.Append(installer::kSetupExe);
base::ProcessHandle ph;
CommandLine cl(CommandLine::NO_PROGRAM);
@@ -114,8 +115,8 @@ bool LaunchSetupForEula(const FilePath::StringType& value, int* ret_code) {
// Populates |path| with the path to |file| in the sentinel directory. This is
// the application directory for user-level installs, and the default user data
// dir for system-level installs. Returns false on error.
-bool GetSentinelFilePath(const wchar_t* file, FilePath* path) {
- FilePath exe_path;
+bool GetSentinelFilePath(const wchar_t* file, base::FilePath* path) {
+ base::FilePath exe_path;
if (!PathService::Get(base::DIR_EXE, &exe_path))
return false;
if (InstallUtil::IsPerUserInstall(exe_path.value().c_str()))
@@ -126,7 +127,7 @@ bool GetSentinelFilePath(const wchar_t* file, FilePath* path) {
return true;
}
-bool GetEULASentinelFilePath(FilePath* path) {
+bool GetEULASentinelFilePath(base::FilePath* path) {
return GetSentinelFilePath(installer::kEULASentinelFile, path);
}
@@ -137,7 +138,7 @@ bool IsEULANotAccepted(installer::MasterPreferences* install_prefs) {
bool value = false;
if (install_prefs->GetBool(installer::master_preferences::kRequireEula,
&value) && value) {
- FilePath eula_sentinel;
+ base::FilePath eula_sentinel;
// Be conservative and show the EULA if the path to the sentinel can't be
// determined.
if (!GetEULASentinelFilePath(&eula_sentinel) ||
@@ -150,7 +151,7 @@ bool IsEULANotAccepted(installer::MasterPreferences* install_prefs) {
// Writes the EULA to a temporary file, returned in |*eula_path|, and returns
// true if successful.
-bool WriteEULAtoTempFile(FilePath* eula_path) {
+bool WriteEULAtoTempFile(base::FilePath* eula_path) {
std::string terms = l10n_util::GetStringUTF8(IDS_TERMS_HTML);
if (terms.empty())
return false;
@@ -165,7 +166,7 @@ bool WriteEULAtoTempFile(FilePath* eula_path) {
// Creates the sentinel indicating that the EULA was required and has been
// accepted.
bool CreateEULASentinel() {
- FilePath eula_sentinel;
+ base::FilePath eula_sentinel;
if (!GetEULASentinelFilePath(&eula_sentinel))
return false;
@@ -320,7 +321,7 @@ int ImportFromBrowser(Profile* profile,
bool ImportSettingsWin(Profile* profile,
int importer_type,
int items_to_import,
- const FilePath& import_bookmarks_path,
+ const base::FilePath& import_bookmarks_path,
bool skip_first_run_ui) {
if (!items_to_import && import_bookmarks_path.empty()) {
return true;
@@ -390,7 +391,7 @@ void DoPostImportPlatformSpecificTasks() {
// making sure shortcuts are created promptly to avoid annoying the user by
// re-creating shortcuts he previously deleted.
static const int64 kTiggerActiveSetupDelaySeconds = 5;
- FilePath chrome_exe;
+ base::FilePath chrome_exe;
if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
NOTREACHED();
} else if (!InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())) {
@@ -409,11 +410,11 @@ bool ImportSettings(Profile* profile,
profile,
importer_list->GetSourceProfileAt(0).importer_type,
items_to_import,
- FilePath(),
+ base::FilePath(),
false);
}
-bool GetFirstRunSentinelFilePath(FilePath* path) {
+bool GetFirstRunSentinelFilePath(base::FilePath* path) {
return GetSentinelFilePath(chrome::kFirstRunSentinel, path);
}
@@ -445,10 +446,10 @@ void SetImportPreferencesAndLaunchImport(
// the importer process and blocks until done or until it fails.
scoped_refptr<ImporterList> importer_list(new ImporterList(NULL));
importer_list->DetectSourceProfilesHack();
- if (!ImportSettingsWin(NULL,
- importer_list->GetSourceProfileAt(0).importer_type,
- out_prefs->do_import_items,
- FilePath::FromWStringHack(UTF8ToWide(import_bookmarks_path)), true)) {
+ if (!ImportSettingsWin(
+ NULL, importer_list->GetSourceProfileAt(0).importer_type,
+ out_prefs->do_import_items, base::FilePath::FromWStringHack(UTF8ToWide(
+ import_bookmarks_path)), true)) {
LOG(WARNING) << "silent import failed";
}
}
@@ -462,7 +463,7 @@ bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs) {
// The actual eula text is in a resource in chrome. We extract it to
// a text file so setup.exe can use it as an inner frame.
- FilePath inner_html;
+ base::FilePath inner_html;
if (WriteEULAtoTempFile(&inner_html)) {
int retcode = 0;
if (!LaunchSetupForEula(inner_html.value(), &retcode) ||
@@ -500,11 +501,11 @@ int ImportNow(Profile* profile, const CommandLine& cmdline) {
return return_code;
}
-FilePath MasterPrefsPath() {
+base::FilePath MasterPrefsPath() {
// The standard location of the master prefs is next to the chrome binary.
- FilePath master_prefs;
+ base::FilePath master_prefs;
if (!PathService::Get(base::DIR_EXE, &master_prefs))
- return FilePath();
+ return base::FilePath();
return master_prefs.AppendASCII(installer::kDefaultMasterPrefs);
}
diff --git a/chrome/browser/first_run/upgrade_util_linux.cc b/chrome/browser/first_run/upgrade_util_linux.cc
index 62aacf4..1a976a4 100644
--- a/chrome/browser/first_run/upgrade_util_linux.cc
+++ b/chrome/browser/first_run/upgrade_util_linux.cc
@@ -35,9 +35,9 @@ void SaveLastModifiedTimeOfExe() {
}
double GetLastModifiedTimeOfExe() {
- FilePath exe_file_path;
+ base::FilePath exe_file_path;
if (!PathService::Get(base::FILE_EXE, &exe_file_path)) {
- LOG(WARNING) << "Failed to get FilePath object for FILE_EXE.";
+ LOG(WARNING) << "Failed to get base::FilePath object for FILE_EXE.";
return saved_last_modified_time_of_exe;
}
base::PlatformFileInfo exe_file_info;
diff --git a/chrome/browser/first_run/upgrade_util_win.cc b/chrome/browser/first_run/upgrade_util_win.cc
index ca267a8..a9e9f19 100644
--- a/chrome/browser/first_run/upgrade_util_win.cc
+++ b/chrome/browser/first_run/upgrade_util_win.cc
@@ -38,7 +38,7 @@
namespace {
-bool GetNewerChromeFile(FilePath* path) {
+bool GetNewerChromeFile(base::FilePath* path) {
if (!PathService::Get(base::DIR_EXE, path))
return false;
*path = path->Append(installer::kChromeNewExe);
@@ -67,9 +67,9 @@ bool InvokeGoogleUpdateForRename() {
return false;
}
-FilePath GetMetroRelauncherPath(const FilePath& chrome_exe,
- const std::string& version_str) {
- FilePath path(chrome_exe.DirName());
+base::FilePath GetMetroRelauncherPath(const base::FilePath& chrome_exe,
+ const std::string& version_str) {
+ base::FilePath path(chrome_exe.DirName());
// The relauncher is ordinarily in the version directory. When running in a
// build tree however (where CHROME_VERSION is not set in the environment)
@@ -101,7 +101,7 @@ bool RelaunchChromeHelper(const CommandLine& command_line, bool mode_switch) {
//
// Pass this Chrome's Start Menu shortcut path to the relauncher so it can
// re-activate chrome via ShellExecute.
- FilePath chrome_exe;
+ base::FilePath chrome_exe;
if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
NOTREACHED();
return false;
@@ -171,19 +171,19 @@ bool RelaunchChromeWithModeSwitch(const CommandLine& command_line) {
}
bool IsUpdatePendingRestart() {
- FilePath new_chrome_exe;
+ base::FilePath new_chrome_exe;
if (!GetNewerChromeFile(&new_chrome_exe))
return false;
return file_util::PathExists(new_chrome_exe);
}
bool SwapNewChromeExeIfPresent() {
- FilePath new_chrome_exe;
+ base::FilePath new_chrome_exe;
if (!GetNewerChromeFile(&new_chrome_exe))
return false;
if (!file_util::PathExists(new_chrome_exe))
return false;
- FilePath cur_chrome_exe;
+ base::FilePath cur_chrome_exe;
if (!PathService::Get(base::FILE_EXE, &cur_chrome_exe))
return false;