| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
| 6 #include "chrome/browser/browser_main_win.h" | 6 #include "chrome/browser/browser_main_win.h" |
| 7 | 7 |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/environment.h" | 14 #include "base/environment.h" |
| 15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
| 16 #include "base/memory/scoped_native_library.h" | 16 #include "base/memory/scoped_native_library.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/nss_util.h" | 18 #include "base/nss_util.h" |
| 19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 21 #include "base/win/windows_version.h" | 21 #include "base/win/windows_version.h" |
| 22 #include "base/win/wrapped_window_proc.h" | 22 #include "base/win/wrapped_window_proc.h" |
| 23 #include "chrome/browser/first_run/first_run.h" | 23 #include "chrome/browser/first_run/first_run.h" |
| 24 #include "chrome/browser/first_run/upgrade.h" | 24 #include "chrome/browser/first_run/upgrade_utils.h" |
| 25 #include "chrome/browser/metrics/metrics_service.h" | 25 #include "chrome/browser/metrics/metrics_service.h" |
| 26 #include "chrome/browser/ui/browser_list.h" | 26 #include "chrome/browser/ui/browser_list.h" |
| 27 #include "chrome/browser/ui/views/uninstall_view.h" | 27 #include "chrome/browser/ui/views/uninstall_view.h" |
| 28 #include "chrome/common/chrome_constants.h" | 28 #include "chrome/common/chrome_constants.h" |
| 29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| 30 #include "chrome/common/env_vars.h" | 30 #include "chrome/common/env_vars.h" |
| 31 #include "chrome/installer/util/browser_distribution.h" | 31 #include "chrome/installer/util/browser_distribution.h" |
| 32 #include "chrome/installer/util/helper.h" | 32 #include "chrome/installer/util/helper.h" |
| 33 #include "chrome/installer/util/install_util.h" | 33 #include "chrome/installer/util/install_util.h" |
| 34 #include "chrome/installer/util/shell_util.h" | 34 #include "chrome/installer/util/shell_util.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 int DoUninstallTasks(bool chrome_still_running) { | 103 int DoUninstallTasks(bool chrome_still_running) { |
| 104 // We want to show a warning to user (and exit) if Chrome is already running | 104 // We want to show a warning to user (and exit) if Chrome is already running |
| 105 // *before* we show the uninstall confirmation dialog box. But while the | 105 // *before* we show the uninstall confirmation dialog box. But while the |
| 106 // uninstall confirmation dialog is up, user might start Chrome, so we | 106 // uninstall confirmation dialog is up, user might start Chrome, so we |
| 107 // check once again after user acknowledges Uninstall dialog. | 107 // check once again after user acknowledges Uninstall dialog. |
| 108 if (chrome_still_running) { | 108 if (chrome_still_running) { |
| 109 ShowCloseBrowserFirstMessageBox(); | 109 ShowCloseBrowserFirstMessageBox(); |
| 110 return ResultCodes::UNINSTALL_CHROME_ALIVE; | 110 return ResultCodes::UNINSTALL_CHROME_ALIVE; |
| 111 } | 111 } |
| 112 int ret = AskForUninstallConfirmation(); | 112 int ret = AskForUninstallConfirmation(); |
| 113 if (Upgrade::IsBrowserAlreadyRunning()) { | 113 if (upgrade_utils::IsBrowserAlreadyRunning()) { |
| 114 ShowCloseBrowserFirstMessageBox(); | 114 ShowCloseBrowserFirstMessageBox(); |
| 115 return ResultCodes::UNINSTALL_CHROME_ALIVE; | 115 return ResultCodes::UNINSTALL_CHROME_ALIVE; |
| 116 } | 116 } |
| 117 | 117 |
| 118 if (ret != ResultCodes::UNINSTALL_USER_CANCEL) { | 118 if (ret != ResultCodes::UNINSTALL_USER_CANCEL) { |
| 119 // The following actions are just best effort. | 119 // The following actions are just best effort. |
| 120 VLOG(1) << "Executing uninstall actions"; | 120 VLOG(1) << "Executing uninstall actions"; |
| 121 if (!FirstRun::RemoveSentinel()) | 121 if (!FirstRun::RemoveSentinel()) |
| 122 VLOG(1) << "Failed to delete sentinel file."; | 122 VLOG(1) << "Failed to delete sentinel file."; |
| 123 // We want to remove user level shortcuts and we only care about the ones | 123 // We want to remove user level shortcuts and we only care about the ones |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 base::EnsureNSPRInit(); | 298 base::EnsureNSPRInit(); |
| 299 } | 299 } |
| 300 } | 300 } |
| 301 }; | 301 }; |
| 302 | 302 |
| 303 // static | 303 // static |
| 304 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( | 304 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( |
| 305 const MainFunctionParams& parameters) { | 305 const MainFunctionParams& parameters) { |
| 306 return new BrowserMainPartsWin(parameters); | 306 return new BrowserMainPartsWin(parameters); |
| 307 } | 307 } |
| OLD | NEW |