Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4324)

Unified Diff: chrome/installer/util/helper.cc

Issue 10826144: Delete both regular and Metro user data dirs on uninstall. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: factored in gab's comments Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/util/helper.h ('k') | chrome/installer/util/product.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/helper.cc
diff --git a/chrome/installer/util/helper.cc b/chrome/installer/util/helper.cc
index 82f8a36be64db68df4a15c1a7420e47b6d6764cd..8d2d0e9b10d9237ba7c292b8cc109af11c36daec 100644
--- a/chrome/installer/util/helper.cc
+++ b/chrome/installer/util/helper.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,6 +7,8 @@
#include "base/logging.h"
#include "base/file_path.h"
#include "base/path_service.h"
+#include "base/win/windows_version.h"
+#include "chrome/common/chrome_constants.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/installation_state.h"
#include "chrome/installer/util/install_util.h"
@@ -40,8 +42,22 @@ FilePath GetChromeInstallPath(bool system_install, BrowserDistribution* dist) {
return GetChromeInstallBasePath(system_install, dist, kInstallBinaryDir);
}
-FilePath GetChromeUserDataPath(BrowserDistribution* dist) {
- return GetChromeInstallBasePath(false, dist, kInstallUserDataDir);
+void GetChromeUserDataPaths(BrowserDistribution* dist,
+ std::vector<FilePath>* paths) {
+ const bool has_metro_data = dist->CanSetAsDefault() &&
+ base::win::GetVersion() >= base::win::VERSION_WIN8;
+ FilePath data_dir(GetChromeInstallBasePath(false, dist, kInstallUserDataDir));
+ if (data_dir.empty()) {
+ paths->clear();
+ } else {
+ paths->resize(has_metro_data ? 2 : 1);
+ (*paths)[0] = data_dir;
+ if (has_metro_data) {
+ (*paths)[1] = data_dir.DirName().Append(
+ chrome::kMetroChromeUserDataSubDir);
+ }
+ }
+ DCHECK(!paths->empty());
}
BrowserDistribution* GetBinariesDistribution(bool system_install) {
« no previous file with comments | « chrome/installer/util/helper.h ('k') | chrome/installer/util/product.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698