summaryrefslogtreecommitdiffstats
path: root/chrome/installer/setup/uninstall.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/installer/setup/uninstall.cc')
-rw-r--r--chrome/installer/setup/uninstall.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 2ad8cf2..1a99803 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -176,17 +176,27 @@ DeleteResult DeleteFilesAndFolders(const std::wstring& exe_path,
file_util::Move(setup_exe_path, temp_file);
}
- // Move the browser's persisted local state
+ // Obtain the location of the user profile data. Chrome Frame needs to
+ // build this path manually since it doesn't use the Chrome default dir.
FilePath user_local_state;
- if (chrome::GetDefaultUserDataDirectory(&user_local_state)) {
+#if defined(CHROME_FRAME_BUILD)
+ bool got_local_state =
+ chrome::GetChromeFrameUserDataDirectory(&user_local_state);
+#else // if !defined(CHROME_FRAME_BUILD)
+ bool got_local_state = chrome::GetDefaultUserDataDirectory(&user_local_state);
+#endif
+
+ // Move the browser's persisted local state
+ if (got_local_state) {
FilePath user_local_file(
user_local_state.Append(chrome::kLocalStateFilename));
-
FilePath path = FilePath::FromWStringHack(*local_state_path);
if (!file_util::CreateTemporaryFile(&path))
LOG(ERROR) << "Failed to create temporary file for Local State.";
else
file_util::CopyFile(user_local_file, path);
+ } else {
+ LOG(ERROR) << "Could not retrieve user's profile directory.";
}
DeleteResult result = DELETE_SUCCEEDED;
@@ -210,7 +220,7 @@ DeleteResult DeleteFilesAndFolders(const std::wstring& exe_path,
#endif
}
- if (delete_profile) {
+ if (delete_profile && got_local_state) {
LOG(INFO) << "Deleting user profile" << user_local_state.value();
if (!file_util::Delete(user_local_state, true)) {
LOG(ERROR) << "Failed to delete user profile dir: "
@@ -521,4 +531,4 @@ installer_util::InstallStatus installer_setup::UninstallChrome(
file_util::Delete(local_state_path, false);
return ret;
-}
+} \ No newline at end of file