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

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

Issue 10895: Add Terminate() to the Process object, have RenderProcessHost use this to avo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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/common/resource_dispatcher.cc ('k') | chrome/installer/util/helper.cc » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <atlbase.h> 9 #include <atlbase.h>
10 #include <windows.h> 10 #include <windows.h>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 void CloseAllChromeProcesses() { 45 void CloseAllChromeProcesses() {
46 for (int j = 0; j < 4; ++j) { 46 for (int j = 0; j < 4; ++j) {
47 std::wstring wnd_class(L"Chrome_ContainerWin_"); 47 std::wstring wnd_class(L"Chrome_ContainerWin_");
48 wnd_class.append(IntToWString(j)); 48 wnd_class.append(IntToWString(j));
49 HWND window = FindWindowEx(NULL, NULL, wnd_class.c_str(), NULL); 49 HWND window = FindWindowEx(NULL, NULL, wnd_class.c_str(), NULL);
50 while (window) { 50 while (window) {
51 HWND tmpWnd = window; 51 HWND tmpWnd = window;
52 window = FindWindowEx(NULL, window, wnd_class.c_str(), NULL); 52 window = FindWindowEx(NULL, window, wnd_class.c_str(), NULL);
53 if (!SendMessageTimeout(tmpWnd, WM_CLOSE, 0, 0, SMTO_BLOCK, 3000, NULL) && 53 if (!SendMessageTimeout(tmpWnd, WM_CLOSE, 0, 0, SMTO_BLOCK, 3000, NULL) &&
54 (GetLastError() == ERROR_TIMEOUT)) { 54 (GetLastError() == ERROR_TIMEOUT)) {
55 process_util::CleanupProcesses(installer_util::kChromeExe, 0, 55 base::CleanupProcesses(installer_util::kChromeExe, 0,
56 ResultCodes::HUNG, NULL); 56 ResultCodes::HUNG, NULL);
57 return; 57 return;
58 } 58 }
59 } 59 }
60 } 60 }
61 61
62 // If asking politely didn't work, wait for 15 seconds and then kill all 62 // If asking politely didn't work, wait for 15 seconds and then kill all
63 // chrome.exe. This check is just in case Chrome is ignoring WM_CLOSE messages . 63 // chrome.exe. This check is just in case Chrome is ignoring WM_CLOSE messages .
64 process_util::CleanupProcesses(installer_util::kChromeExe, 15000, 64 base::CleanupProcesses(installer_util::kChromeExe, 15000,
65 ResultCodes::HUNG, NULL); 65 ResultCodes::HUNG, NULL);
66 } 66 }
67 67
68 // This method deletes Chrome shortcut folder from Windows Start menu. It 68 // This method deletes Chrome shortcut folder from Windows Start menu. It
69 // checks system_uninstall to see if the shortcut is in all users start menu 69 // checks system_uninstall to see if the shortcut is in all users start menu
70 // or current user start menu. 70 // or current user start menu.
71 void DeleteChromeShortcut(bool system_uninstall) { 71 void DeleteChromeShortcut(bool system_uninstall) {
72 std::wstring shortcut_path; 72 std::wstring shortcut_path;
73 if (system_uninstall) { 73 if (system_uninstall) {
74 PathService::Get(base::DIR_COMMON_START_MENU, &shortcut_path); 74 PathService::Get(base::DIR_COMMON_START_MENU, &shortcut_path);
75 // In case of system level uninstall, we want to remove desktop and 75 // In case of system level uninstall, we want to remove desktop and
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 // Finally delete all the files from Chrome folder after moving setup.exe 280 // Finally delete all the files from Chrome folder after moving setup.exe
281 // to a temp location. 281 // to a temp location.
282 if (!DeleteFilesAndFolders(exe_path, system_uninstall, installed_version)) 282 if (!DeleteFilesAndFolders(exe_path, system_uninstall, installed_version))
283 return installer_util::UNINSTALL_FAILED; 283 return installer_util::UNINSTALL_FAILED;
284 284
285 LOG(INFO) << "Uninstallation complete. Launching Uninstall survey."; 285 LOG(INFO) << "Uninstallation complete. Launching Uninstall survey.";
286 dist->DoPostUninstallOperations(installed_version); 286 dist->DoPostUninstallOperations(installed_version);
287 return installer_util::UNINSTALL_SUCCESSFUL; 287 return installer_util::UNINSTALL_SUCCESSFUL;
288 } 288 }
289 289
OLDNEW
« no previous file with comments | « chrome/common/resource_dispatcher.cc ('k') | chrome/installer/util/helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698