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-02-01 04:52:17 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-01 04:52:17 +0000
commite5ab799c647a5fa26ccb5f55352fdce7e39cfded (patch)
tree8189cd34cb9064fe691fbb1f25f6f6899f117583 /chrome/app/chrome_exe_main_win.cc
parent496700a7f47063baf51e28b18aa6cc191892f60b (diff)
downloadchromium_src-e5ab799c647a5fa26ccb5f55352fdce7e39cfded.zip
chromium_src-e5ab799c647a5fa26ccb5f55352fdce7e39cfded.tar.gz
chromium_src-e5ab799c647a5fa26ccb5f55352fdce7e39cfded.tar.bz2
Revert 248331 "Revert 247156 "Revert 247151 "Cleanup of windows ..."
Basically reverting 247151 which still breaks the tree. > Revert 247156 "Revert 247151 "Cleanup of windows launch code"" > > This re-enables 247151 because I can't repro it > so it is possible it was a temporary NaCL insanity and definitely > the x64 breakage was a flake as confirmed by try jobs. > > > > Revert 247151 "Cleanup of windows launch code" > > > > > 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 > > > > TBR=cpu@chromium.org > > > > Review URL: https://codereview.chromium.org/140123006 > > TBR=cpu@chromium.org > > Review URL: https://codereview.chromium.org/151683004 TBR=cpu@chromium.org Review URL: https://codereview.chromium.org/152033002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248332 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, 36 insertions, 25 deletions
diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc
index 3c93752..51b1edf 100644
--- a/chrome/app/chrome_exe_main_win.cc
+++ b/chrome/app/chrome_exe_main_win.cc
@@ -13,6 +13,7 @@
#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"
@@ -40,6 +41,36 @@ 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
@@ -104,29 +135,9 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) {
if (AttemptFastNotify(*CommandLine::ForCurrentProcess()))
return 0;
- 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;
+ 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);
}