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

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

Issue 11417036: Fix user-level Chrome self-destruction issues on Windows 8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Kill delegate_execute only on Win8 and only remove dialog on Win8/Metro Created 8 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
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 <windows.h> 9 #include <windows.h>
10 10
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 std::string reactivation_brand(WideToASCII(reactivation_brand_wide)); 178 std::string reactivation_brand(WideToASCII(reactivation_brand_wide));
179 rlz_lib::SupplementaryBranding branding(reactivation_brand.c_str()); 179 rlz_lib::SupplementaryBranding branding(reactivation_brand.c_str());
180 rlz_lib::ClearProductState(rlz_lib::CHROME, points); 180 rlz_lib::ClearProductState(rlz_lib::CHROME, points);
181 } 181 }
182 } 182 }
183 183
184 } // namespace 184 } // namespace
185 185
186 namespace installer { 186 namespace installer {
187 187
188 // This functions checks for any Chrome instances that are 188 // Kills all Chrome processes, immediately.
189 // running and first asks them to close politely by sending a Windows message.
190 // If there is an error while sending message or if there are still Chrome
191 // procesess active after the message has been sent, this function will try
192 // to kill them.
193 void CloseAllChromeProcesses() { 189 void CloseAllChromeProcesses() {
194 for (int j = 0; j < 4; ++j) { 190 base::CleanupProcesses(installer::kChromeExe, base::TimeDelta(),
195 string16 wnd_class(L"Chrome_WidgetWin_"); 191 content::RESULT_CODE_HUNG, NULL);
196 wnd_class.append(base::IntToString16(j)); 192 base::CleanupProcesses(installer::kNaClExe, base::TimeDelta(),
197 HWND window = FindWindowEx(NULL, NULL, wnd_class.c_str(), NULL); 193 content::RESULT_CODE_HUNG, NULL);
198 while (window) { 194 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
199 HWND tmpWnd = window; 195 base::CleanupProcesses(installer::kDelegateExecuteExe, base::TimeDelta(),
200 window = FindWindowEx(NULL, window, wnd_class.c_str(), NULL); 196 content::RESULT_CODE_HUNG, NULL);
201 if (!SendMessageTimeout(tmpWnd, WM_CLOSE, 0, 0, SMTO_BLOCK, 3000, NULL) &&
202 (GetLastError() == ERROR_TIMEOUT)) {
203 base::CleanupProcesses(installer::kChromeExe, base::TimeDelta(),
204 content::RESULT_CODE_HUNG, NULL);
205 base::CleanupProcesses(installer::kNaClExe, base::TimeDelta(),
206 content::RESULT_CODE_HUNG, NULL);
207 return;
208 }
209 }
210 } 197 }
211
212 // If asking politely didn't work, wait for 15 seconds and then kill all
213 // chrome.exe. This check is just in case Chrome is ignoring WM_CLOSE
214 // messages.
215 base::CleanupProcesses(installer::kChromeExe,
216 base::TimeDelta::FromSeconds(15),
217 content::RESULT_CODE_HUNG, NULL);
218 base::CleanupProcesses(installer::kNaClExe,
219 base::TimeDelta::FromSeconds(15),
220 content::RESULT_CODE_HUNG, NULL);
221 } 198 }
222 199
223 // Attempts to close the Chrome Frame helper process by sending WM_CLOSE 200 // Attempts to close the Chrome Frame helper process by sending WM_CLOSE
224 // messages to its window, or just killing it if that doesn't work. 201 // messages to its window, or just killing it if that doesn't work.
225 void CloseChromeFrameHelperProcess() { 202 void CloseChromeFrameHelperProcess() {
226 HWND window = FindWindow(installer::kChromeFrameHelperWndClass, NULL); 203 HWND window = FindWindow(installer::kChromeFrameHelperWndClass, NULL);
227 if (!::IsWindow(window)) 204 if (!::IsWindow(window))
228 return; 205 return;
229 206
230 const DWORD kWaitMs = 3000; 207 const DWORD kWaitMs = 3000;
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 const ProductState* system_level_product_state = 1254 const ProductState* system_level_product_state =
1278 original_state.GetProductState(true, browser_dist->GetType()); 1255 original_state.GetProductState(true, browser_dist->GetType());
1279 if (system_level_product_state) 1256 if (system_level_product_state)
1280 InstallUtil::TriggerActiveSetupCommand(); 1257 InstallUtil::TriggerActiveSetupCommand();
1281 } 1258 }
1282 1259
1283 return ret; 1260 return ret;
1284 } 1261 }
1285 1262
1286 } // namespace installer 1263 } // namespace installer
OLDNEW
« chrome/browser/chrome_browser_main_win.cc ('K') | « chrome/browser/chrome_browser_main_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698