| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | |
| 6 #include <windows.h> | 5 #include <windows.h> |
| 7 #include <DbgHelp.h> | 6 #include <DbgHelp.h> |
| 8 #include <string> | 7 #include <string> |
| 9 | 8 |
| 10 #include "chrome_frame/chrome_launcher.h" | 9 #include "chrome_frame/chrome_launcher.h" |
| 11 #include "chrome_frame/crash_server_init.h" | 10 #include "chrome_frame/crash_server_init.h" |
| 12 | 11 #include "chrome_frame/update_launcher.h" |
| 13 | 12 |
| 14 int APIENTRY wWinMain(HINSTANCE, HINSTANCE, wchar_t*, int) { | 13 int APIENTRY wWinMain(HINSTANCE, HINSTANCE, wchar_t*, int) { |
| 15 const wchar_t* cmd_line = ::GetCommandLine(); | 14 const wchar_t* cmd_line = ::GetCommandLine(); |
| 16 | 15 |
| 17 google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad( | 16 google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad( |
| 18 InitializeCrashReporting(cmd_line)); | 17 InitializeCrashReporting(cmd_line)); |
| 19 | 18 |
| 19 std::wstring update_command = |
| 20 update_launcher::GetUpdateCommandFromArguments(cmd_line); |
| 21 |
| 20 UINT exit_code = ERROR_FILE_NOT_FOUND; | 22 UINT exit_code = ERROR_FILE_NOT_FOUND; |
| 21 if (chrome_launcher::SanitizeAndLaunchChrome(::GetCommandLine())) { | 23 |
| 24 if (!update_command.empty()) |
| 25 exit_code = update_launcher::LaunchUpdateCommand(update_command); |
| 26 else if (chrome_launcher::SanitizeAndLaunchChrome(cmd_line)) |
| 22 exit_code = ERROR_SUCCESS; | 27 exit_code = ERROR_SUCCESS; |
| 23 } | |
| 24 | 28 |
| 25 return exit_code; | 29 return exit_code; |
| 26 } | 30 } |
| OLD | NEW |