OLD | NEW |
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 #include "chrome/browser/chrome_browser_main_win.h" | 5 #include "chrome/browser/chrome_browser_main_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "chrome/browser/profiles/profile_info_cache.h" | 31 #include "chrome/browser/profiles/profile_info_cache.h" |
32 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 32 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
33 #include "chrome/browser/shell_integration.h" | 33 #include "chrome/browser/shell_integration.h" |
34 #include "chrome/browser/ui/simple_message_box.h" | 34 #include "chrome/browser/ui/simple_message_box.h" |
35 #include "chrome/browser/ui/uninstall_browser_prompt.h" | 35 #include "chrome/browser/ui/uninstall_browser_prompt.h" |
36 #include "chrome/common/chrome_constants.h" | 36 #include "chrome/common/chrome_constants.h" |
37 #include "chrome/common/chrome_result_codes.h" | 37 #include "chrome/common/chrome_result_codes.h" |
38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
39 #include "chrome/common/chrome_version_info.h" | 39 #include "chrome/common/chrome_version_info.h" |
40 #include "chrome/common/env_vars.h" | 40 #include "chrome/common/env_vars.h" |
41 #include "chrome/installer/launcher_support/chrome_launcher_support.h" | |
42 #include "chrome/installer/util/browser_distribution.h" | 41 #include "chrome/installer/util/browser_distribution.h" |
43 #include "chrome/installer/util/helper.h" | 42 #include "chrome/installer/util/helper.h" |
44 #include "chrome/installer/util/install_util.h" | 43 #include "chrome/installer/util/install_util.h" |
45 #include "chrome/installer/util/l10n_string_util.h" | 44 #include "chrome/installer/util/l10n_string_util.h" |
46 #include "chrome/installer/util/shell_util.h" | 45 #include "chrome/installer/util/shell_util.h" |
47 #include "content/public/browser/browser_thread.h" | 46 #include "content/public/browser/browser_thread.h" |
48 #include "content/public/common/main_function_params.h" | 47 #include "content/public/common/main_function_params.h" |
49 #include "grit/app_locale_settings.h" | 48 #include "grit/app_locale_settings.h" |
50 #include "grit/chromium_strings.h" | 49 #include "grit/chromium_strings.h" |
51 #include "grit/generated_resources.h" | 50 #include "grit/generated_resources.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 111 |
113 int DoUninstallTasks(bool chrome_still_running) { | 112 int DoUninstallTasks(bool chrome_still_running) { |
114 // We want to show a warning to user (and exit) if Chrome is already running | 113 // We want to show a warning to user (and exit) if Chrome is already running |
115 // *before* we show the uninstall confirmation dialog box. But while the | 114 // *before* we show the uninstall confirmation dialog box. But while the |
116 // uninstall confirmation dialog is up, user might start Chrome, so we | 115 // uninstall confirmation dialog is up, user might start Chrome, so we |
117 // check once again after user acknowledges Uninstall dialog. | 116 // check once again after user acknowledges Uninstall dialog. |
118 if (chrome_still_running) { | 117 if (chrome_still_running) { |
119 ShowCloseBrowserFirstMessageBox(); | 118 ShowCloseBrowserFirstMessageBox(); |
120 return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; | 119 return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; |
121 } | 120 } |
122 int result = chrome::ShowUninstallBrowserPrompt( | 121 int result = chrome::ShowUninstallBrowserPrompt(); |
123 !chrome_launcher_support::IsAppLauncherPresent()); | |
124 // Don't offer to delete the profile if the App Launcher is also installed. | |
125 if (browser_util::IsBrowserAlreadyRunning()) { | 122 if (browser_util::IsBrowserAlreadyRunning()) { |
126 ShowCloseBrowserFirstMessageBox(); | 123 ShowCloseBrowserFirstMessageBox(); |
127 return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; | 124 return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; |
128 } | 125 } |
129 | 126 |
130 if (result != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) { | 127 if (result != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) { |
131 // The following actions are just best effort. | 128 // The following actions are just best effort. |
132 // TODO(gab): Look into removing this code which is now redundant with the | 129 // TODO(gab): Look into removing this code which is now redundant with the |
133 // work done by setup.exe on uninstall. | 130 // work done by setup.exe on uninstall. |
134 VLOG(1) << "Executing uninstall actions"; | 131 VLOG(1) << "Executing uninstall actions"; |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 if (resource_id) | 438 if (resource_id) |
442 return l10n_util::GetStringUTF16(resource_id); | 439 return l10n_util::GetStringUTF16(resource_id); |
443 return base::string16(); | 440 return base::string16(); |
444 } | 441 } |
445 | 442 |
446 // static | 443 // static |
447 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 444 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
448 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 445 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
449 installer::SetTranslationDelegate(&delegate); | 446 installer::SetTranslationDelegate(&delegate); |
450 } | 447 } |
OLD | NEW |