summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main_win.cc
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-20 18:22:40 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-20 18:22:40 +0000
commit6b208c8951739a6e27b7569601420842022af4bd (patch)
treeb2e12a9c9af271e58e7f1faf14f031b00ba46fc1 /chrome/browser/browser_main_win.cc
parentcc50156fdf206d2190f52032211bc34e8766f47c (diff)
downloadchromium_src-6b208c8951739a6e27b7569601420842022af4bd.zip
chromium_src-6b208c8951739a6e27b7569601420842022af4bd.tar.gz
chromium_src-6b208c8951739a6e27b7569601420842022af4bd.tar.bz2
During uninstall if Chrome is set as default, allow user to choose another browser as default.
BUG=14023 TEST=Make sure the option of choosing a different browser shows up during uninstall (and works as intended) iff chrome is set as default browser. Review URL: http://codereview.chromium.org/172080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23841 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main_win.cc')
-rw-r--r--chrome/browser/browser_main_win.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/chrome/browser/browser_main_win.cc b/chrome/browser/browser_main_win.cc
index b4f1052..cb3551a 100644
--- a/chrome/browser/browser_main_win.cc
+++ b/chrome/browser/browser_main_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -15,7 +15,7 @@
#include "base/win_util.h"
#include "chrome/browser/first_run.h"
#include "chrome/browser/metrics/metrics_service.h"
-#include "chrome/browser/views/uninstall_dialog.h"
+#include "chrome/browser/views/uninstall_view.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/result_codes.h"
@@ -24,7 +24,6 @@
#include "chrome/installer/util/shell_util.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
-#include "views/controls/message_box_view.h"
#include "views/focus/accelerator_handler.h"
#include "views/window/window.h"
@@ -43,7 +42,8 @@ bool CheckForWin2000() {
int AskForUninstallConfirmation() {
int ret = ResultCodes::NORMAL_EXIT;
- UninstallDialog::ShowUninstallDialog(ret);
+ views::Window::CreateChromeWindow(NULL, gfx::Rect(),
+ new UninstallView(ret))->Show();
views::AcceleratorHandler accelerator_handler;
MessageLoopForUI::current()->Run(&accelerator_handler);
return ret;
@@ -57,11 +57,20 @@ void ShowCloseBrowserFirstMessageBox() {
}
int DoUninstallTasks(bool chrome_still_running) {
+ // We want to show a warning to user (and exit) if Chrome is already running
+ // *before* we show the uninstall confirmation dialog box. But while the
+ // uninstall confirmation dialog is up, user might start Chrome, so we
+ // check once again after user acknowledges Uninstall dialog.
if (chrome_still_running) {
ShowCloseBrowserFirstMessageBox();
return ResultCodes::UNINSTALL_CHROME_ALIVE;
}
int ret = AskForUninstallConfirmation();
+ if (Upgrade::IsBrowserAlreadyRunning()) {
+ ShowCloseBrowserFirstMessageBox();
+ return ResultCodes::UNINSTALL_CHROME_ALIVE;
+ }
+
if (ret != ResultCodes::UNINSTALL_USER_CANCEL) {
// The following actions are just best effort.
LOG(INFO) << "Executing uninstall actions";