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