| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <tchar.h> | 6 #include <tchar.h> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #if defined(GOOGLE_CHROME_BUILD) | 48 #if defined(GOOGLE_CHROME_BUILD) |
| 49 google_update::GoogleUpdateClient client; | 49 google_update::GoogleUpdateClient client; |
| 50 | 50 |
| 51 // TODO(erikkay): Get guid from build macros rather than hardcoding. | 51 // TODO(erikkay): Get guid from build macros rather than hardcoding. |
| 52 // TODO(erikkay): verify client.Init() return value for official builds | 52 // TODO(erikkay): verify client.Init() return value for official builds |
| 53 client.Init(L"{8A69D345-D564-463c-AFF1-A69D9E530F96}", dll_name); | 53 client.Init(L"{8A69D345-D564-463c-AFF1-A69D9E530F96}", dll_name); |
| 54 | 54 |
| 55 // Initialize the crash reporter. | 55 // Initialize the crash reporter. |
| 56 InitCrashReporter(client.GetDLLPath()); | 56 InitCrashReporter(client.GetDLLPath()); |
| 57 | 57 |
| 58 bool exit_now = false; | 58 bool exit_now = true; |
| 59 if (ShowRestartDialogIfCrashed(&exit_now)) { | 59 if (ShowRestartDialogIfCrashed(&exit_now)) { |
| 60 // We have restarted because of a previous crash. The user might | 60 // We have restarted because of a previous crash. The user might |
| 61 // decide that he does not want to continue. | 61 // decide that he does not want to continue. |
| 62 if (exit_now) | 62 if (exit_now) |
| 63 return ResultCodes::NORMAL_EXIT; | 63 return ResultCodes::NORMAL_EXIT; |
| 64 } | 64 } |
| 65 | 65 |
| 66 int ret = 0; | 66 int ret = 0; |
| 67 if (client.Launch(instance, &sandbox_info, command_line, "ChromeMain", | 67 if (client.Launch(instance, &sandbox_info, command_line, "ChromeMain", |
| 68 &ret)) { | 68 &ret)) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 81 ::SetCurrentDirectory(dll_path.c_str()); | 81 ::SetCurrentDirectory(dll_path.c_str()); |
| 82 delete[] version; | 82 delete[] version; |
| 83 } | 83 } |
| 84 | 84 |
| 85 HINSTANCE dll_handle = ::LoadLibraryEx(dll_name, NULL, | 85 HINSTANCE dll_handle = ::LoadLibraryEx(dll_name, NULL, |
| 86 LOAD_WITH_ALTERED_SEARCH_PATH); | 86 LOAD_WITH_ALTERED_SEARCH_PATH); |
| 87 | 87 |
| 88 // Initialize the crash reporter. | 88 // Initialize the crash reporter. |
| 89 InitCrashReporter(client_util::GetDLLPath(dll_name, dll_path)); | 89 InitCrashReporter(client_util::GetDLLPath(dll_name, dll_path)); |
| 90 | 90 |
| 91 bool exit_now = true; |
| 92 if (ShowRestartDialogIfCrashed(&exit_now)) { |
| 93 // We have restarted because of a previous crash. The user might |
| 94 // decide that he does not want to continue. |
| 95 if (exit_now) |
| 96 return ResultCodes::NORMAL_EXIT; |
| 97 } |
| 98 |
| 91 if (NULL != dll_handle) { | 99 if (NULL != dll_handle) { |
| 92 client_util::DLL_MAIN entry = reinterpret_cast<client_util::DLL_MAIN>( | 100 client_util::DLL_MAIN entry = reinterpret_cast<client_util::DLL_MAIN>( |
| 93 ::GetProcAddress(dll_handle, "ChromeMain")); | 101 ::GetProcAddress(dll_handle, "ChromeMain")); |
| 94 if (NULL != entry) | 102 if (NULL != entry) |
| 95 return (entry)(instance, &sandbox_info, command_line); | 103 return (entry)(instance, &sandbox_info, command_line); |
| 96 } | 104 } |
| 97 #endif | 105 #endif |
| 98 | 106 |
| 99 return ResultCodes::GOOGLE_UPDATE_LAUNCH_FAILED; | 107 return ResultCodes::GOOGLE_UPDATE_LAUNCH_FAILED; |
| 100 } | 108 } |
| 101 | 109 |
| OLD | NEW |