summaryrefslogtreecommitdiffstats
path: root/chrome/app/chrome_exe_main_win.cc
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-25 22:52:35 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-25 22:52:35 +0000
commitccd6a41b17ce6df602c0620341bd667da4d8cbcd (patch)
treea240c94245d722928581ece84e7748eb47564198 /chrome/app/chrome_exe_main_win.cc
parent58d72b5fa365f01894582bdcdb43ae02f057c96e (diff)
downloadchromium_src-ccd6a41b17ce6df602c0620341bd667da4d8cbcd.zip
chromium_src-ccd6a41b17ce6df602c0620341bd667da4d8cbcd.tar.gz
chromium_src-ccd6a41b17ce6df602c0620341bd667da4d8cbcd.tar.bz2
Cleanup of windows launch code
The windows startup code was handling aura and non-aura cases which require different startup logic in metro (immersive mode). Since we don't support the non-Aura logic we can get rid of a lot of code. Tbring gab for the installer constant addition. R=ananta@chromium.org, scottmg@chromium.org TBR=gab BUG=none Review URL: https://codereview.chromium.org/142473002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247151 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_exe_main_win.cc')
-rw-r--r--chrome/app/chrome_exe_main_win.cc61
1 files changed, 25 insertions, 36 deletions
diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc
index 51b1edf..3c93752 100644
--- a/chrome/app/chrome_exe_main_win.cc
+++ b/chrome/app/chrome_exe_main_win.cc
@@ -13,7 +13,6 @@
#include "base/lazy_instance.h"
#include "chrome/app/chrome_breakpad_client.h"
#include "chrome/app/client_util.h"
-#include "chrome/app/metro_driver_win.h"
#include "chrome/browser/chrome_process_finder_win.h"
#include "chrome/browser/policy/policy_path_parser.h"
#include "chrome/common/chrome_constants.h"
@@ -41,36 +40,6 @@ void CheckSafeModeLaunch() {
::SetEnvironmentVariableA(chrome::kSafeModeEnvVar, "1");
}
-int RunChrome(HINSTANCE instance) {
- breakpad::SetBreakpadClient(g_chrome_breakpad_client.Pointer());
-
- CheckSafeModeLaunch();
-
- bool exit_now = true;
- // We restarted because of a previous crash. Ask user if we should relaunch.
- // Only show this for the browser process. See crbug.com/132119.
- const std::string process_type =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kProcessType);
- if (process_type.empty()) {
- if (breakpad::ShowRestartDialogIfCrashed(&exit_now)) {
- if (exit_now)
- return content::RESULT_CODE_NORMAL_EXIT;
- }
- }
-
- // Initialize the sandbox services.
- sandbox::SandboxInterfaceInfo sandbox_info = {0};
- content::InitializeSandboxInfo(&sandbox_info);
-
- // Load and launch the chrome dll. *Everything* happens inside.
- MainDllLoader* loader = MakeMainDllLoader();
- int rc = loader->Launch(instance, &sandbox_info);
- loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();
- delete loader;
- return rc;
-}
-
// List of switches that it's safe to rendezvous early with. Fast start should
// not be done if a command line contains a switch not in this set.
// Note this is currently stored as a list of two because it's probably faster
@@ -135,9 +104,29 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) {
if (AttemptFastNotify(*CommandLine::ForCurrentProcess()))
return 0;
- MetroDriver metro_driver;
- if (metro_driver.in_metro_mode())
- return metro_driver.RunInMetro(instance, &RunChrome);
- // Not in metro mode, proceed as normal.
- return RunChrome(instance);
+ breakpad::SetBreakpadClient(g_chrome_breakpad_client.Pointer());
+ CheckSafeModeLaunch();
+
+ bool exit_now = true;
+ // We restarted because of a previous crash. Ask user if we should relaunch.
+ // Only show this for the browser process. See crbug.com/132119.
+ bool const is_browser =
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kProcessType).empty();
+ if (is_browser) {
+ if (breakpad::ShowRestartDialogIfCrashed(&exit_now)) {
+ if (exit_now)
+ return content::RESULT_CODE_NORMAL_EXIT;
+ }
+ }
+
+ // Initialize the sandbox services.
+ sandbox::SandboxInterfaceInfo sandbox_info = {0};
+ content::InitializeSandboxInfo(&sandbox_info);
+ // Load and launch the chrome dll. *Everything* happens inside.
+ MainDllLoader* loader = MakeMainDllLoader();
+ int rc = loader->Launch(instance, &sandbox_info);
+ loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();
+ delete loader;
+ return rc;
}