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

Side by Side Diff: chrome/installer/setup/uninstall.cc

Issue 10446111: Abstract suffixing logic away from GetApplicationName (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on suffix@r142211 Created 8 years, 6 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
« no previous file with comments | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/util/browser_distribution.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This file defines the methods useful for uninstalling Chrome. 5 // This file defines the methods useful for uninstalling Chrome.
6 6
7 #include "chrome/installer/setup/uninstall.h" 7 #include "chrome/installer/setup/uninstall.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 string16(L".DEFAULT\\").append( 565 string16(L".DEFAULT\\").append(
566 ShellUtil::kRegStartMenuInternet).c_str(), 566 ShellUtil::kRegStartMenuInternet).c_str(),
567 L"", InstallUtil::ValueEquals(client_name)); 567 L"", InstallUtil::ValueEquals(client_name));
568 } 568 }
569 } 569 }
570 } 570 }
571 } 571 }
572 572
573 // Delete Software\RegisteredApplications\Chromium 573 // Delete Software\RegisteredApplications\Chromium
574 InstallUtil::DeleteRegistryValue(root, ShellUtil::kRegRegisteredApplications, 574 InstallUtil::DeleteRegistryValue(root, ShellUtil::kRegRegisteredApplications,
575 dist->GetApplicationName() + browser_entry_suffix); 575 dist->GetBaseAppName() + browser_entry_suffix);
576 576
577 // Delete Software\Classes\Applications\chrome.exe 577 // Delete Software\Classes\Applications\chrome.exe
578 string16 app_key(ShellUtil::kRegClasses); 578 string16 app_key(ShellUtil::kRegClasses);
579 app_key.push_back(FilePath::kSeparators[0]); 579 app_key.push_back(FilePath::kSeparators[0]);
580 app_key.append(L"Applications"); 580 app_key.append(L"Applications");
581 app_key.push_back(FilePath::kSeparators[0]); 581 app_key.push_back(FilePath::kSeparators[0]);
582 app_key.append(installer::kChromeExe); 582 app_key.append(installer::kChromeExe);
583 InstallUtil::DeleteRegistryKey(root, app_key); 583 InstallUtil::DeleteRegistryKey(root, app_key);
584 584
585 // Delete the App Paths key that lets explorer find Chrome. 585 // Delete the App Paths key that lets explorer find Chrome.
(...skipping 16 matching lines...) Expand all
602 } 602 }
603 603
604 // Cleanup in case Chrome had been made the default browser. 604 // Cleanup in case Chrome had been made the default browser.
605 605
606 // Delete the default value of SOFTWARE\Clients\StartMenuInternet if it 606 // Delete the default value of SOFTWARE\Clients\StartMenuInternet if it
607 // references this Chrome. Do this explicitly here for the case where HKCU is 607 // references this Chrome. Do this explicitly here for the case where HKCU is
608 // being processed; the iteration above will have no hits since registration 608 // being processed; the iteration above will have no hits since registration
609 // lives in HKLM. 609 // lives in HKLM.
610 InstallUtil::DeleteRegistryValueIf( 610 InstallUtil::DeleteRegistryValueIf(
611 root, ShellUtil::kRegStartMenuInternet, L"", 611 root, ShellUtil::kRegStartMenuInternet, L"",
612 InstallUtil::ValueEquals(dist->GetApplicationName() + 612 InstallUtil::ValueEquals(dist->GetBaseAppName() + browser_entry_suffix));
613 browser_entry_suffix));
614 613
615 // Delete each protocol association if it references this Chrome. 614 // Delete each protocol association if it references this Chrome.
616 InstallUtil::ProgramCompare open_command_pred(chrome_exe); 615 InstallUtil::ProgramCompare open_command_pred(chrome_exe);
617 string16 parent_key(ShellUtil::kRegClasses); 616 string16 parent_key(ShellUtil::kRegClasses);
618 const string16::size_type base_length = parent_key.size(); 617 const string16::size_type base_length = parent_key.size();
619 string16 child_key; 618 string16 child_key;
620 for (const wchar_t* const* proto = 619 for (const wchar_t* const* proto =
621 &ShellUtil::kPotentialProtocolAssociations[0]; 620 &ShellUtil::kPotentialProtocolAssociations[0];
622 *proto != NULL; 621 *proto != NULL;
623 ++proto) { 622 ++proto) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 InstallStatus status = installer::UNINSTALL_CONFIRMED; 704 InstallStatus status = installer::UNINSTALL_CONFIRMED;
706 BrowserDistribution* browser_dist = product.distribution(); 705 BrowserDistribution* browser_dist = product.distribution();
707 const string16 chrome_exe( 706 const string16 chrome_exe(
708 installer_state.target_path().Append(installer::kChromeExe).value()); 707 installer_state.target_path().Append(installer::kChromeExe).value());
709 708
710 const string16 suffix(ShellUtil::GetCurrentInstallationSuffix(browser_dist, 709 const string16 suffix(ShellUtil::GetCurrentInstallationSuffix(browser_dist,
711 chrome_exe)); 710 chrome_exe));
712 711
713 bool is_chrome = product.is_chrome(); 712 bool is_chrome = product.is_chrome();
714 713
715 VLOG(1) << "UninstallProduct: " << browser_dist->GetApplicationName(); 714 VLOG(1) << "UninstallProduct: " << browser_dist->GetAppShortCutName();
716 715
717 if (force_uninstall) { 716 if (force_uninstall) {
718 // Since --force-uninstall command line option is used, we are going to 717 // Since --force-uninstall command line option is used, we are going to
719 // do silent uninstall. Try to close all running Chrome instances. 718 // do silent uninstall. Try to close all running Chrome instances.
720 // NOTE: We don't do this for Chrome Frame. 719 // NOTE: We don't do this for Chrome Frame.
721 if (is_chrome) 720 if (is_chrome)
722 CloseAllChromeProcesses(); 721 CloseAllChromeProcesses();
723 } else if (is_chrome) { 722 } else if (is_chrome) {
724 // no --force-uninstall so lets show some UI dialog boxes. 723 // no --force-uninstall so lets show some UI dialog boxes.
725 status = IsChromeActiveOrUserCancelled(installer_state, product); 724 status = IsChromeActiveOrUserCancelled(installer_state, product);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 948
950 // Try and delete the preserved local state once the post-install 949 // Try and delete the preserved local state once the post-install
951 // operations are complete. 950 // operations are complete.
952 if (!backup_state_file.empty()) 951 if (!backup_state_file.empty())
953 file_util::Delete(backup_state_file, false); 952 file_util::Delete(backup_state_file, false);
954 953
955 return ret; 954 return ret;
956 } 955 }
957 956
958 } // namespace installer 957 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/util/browser_distribution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698