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

Side by Side Diff: chrome/installer/util/auto_launch_util.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/installer/util/auto_launch_util.h" 5 #include "chrome/installer/util/auto_launch_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 43 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
44 if (command_line.HasSwitch(switches::kUserDataDir)) { 44 if (command_line.HasSwitch(switches::kUserDataDir)) {
45 path = command_line.GetSwitchValuePath(switches::kUserDataDir); 45 path = command_line.GetSwitchValuePath(switches::kUserDataDir);
46 } else { 46 } else {
47 // Get the path from the same source as the installer, to make sure there 47 // Get the path from the same source as the installer, to make sure there
48 // are no differences. 48 // are no differences.
49 BrowserDistribution* distribution = 49 BrowserDistribution* distribution =
50 BrowserDistribution::GetSpecificDistribution( 50 BrowserDistribution::GetSpecificDistribution(
51 BrowserDistribution::CHROME_BROWSER); 51 BrowserDistribution::CHROME_BROWSER);
52 installer::Product product(distribution); 52 installer::Product product(distribution);
53 path = product.GetUserDataPath(); 53 std::vector<FilePath> data_dir_paths;
54 product.GetUserDataPaths(&data_dir_paths);
55 if (!data_dir_paths.empty())
56 path = data_dir_paths[0];
54 } 57 }
55 path = path.Append(profile_directory); 58 path = path.Append(profile_directory);
56 59
57 std::string input(path.AsUTF8Unsafe()); 60 std::string input(path.AsUTF8Unsafe());
58 uint8 hash[16]; 61 uint8 hash[16];
59 crypto::SHA256HashString(input, hash, sizeof(hash)); 62 crypto::SHA256HashString(input, hash, sizeof(hash));
60 std::string hash_string = base::HexEncode(hash, sizeof(hash)); 63 std::string hash_string = base::HexEncode(hash, sizeof(hash));
61 return string16(kAutolaunchKeyValue) + 64 return string16(kAutolaunchKeyValue) +
62 ASCIIToWide("_") + ASCIIToWide(hash_string); 65 ASCIIToWide("_") + ASCIIToWide(hash_string);
63 } 66 }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 246 }
244 247
245 void DisableBackgroundStartAtLogin() { 248 void DisableBackgroundStartAtLogin() {
246 SetWillLaunchAtLogin(FilePath(), 249 SetWillLaunchAtLogin(FilePath(),
247 ASCIIToUTF16(chrome::kInitialProfile), 250 ASCIIToUTF16(chrome::kInitialProfile),
248 FLAG_PRESERVE, 251 FLAG_PRESERVE,
249 FLAG_DISABLE); 252 FLAG_DISABLE);
250 } 253 }
251 254
252 } // namespace auto_launch_util 255 } // namespace auto_launch_util
OLDNEW
« no previous file with comments | « chrome/installer/setup/uninstall.cc ('k') | chrome/installer/util/google_chrome_distribution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698