| 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 <atlbase.h> | 5 #include <atlbase.h> |
| 6 #include <atlcom.h> | 6 #include <atlcom.h> |
| 7 #include <atlctl.h> | 7 #include <atlctl.h> |
| 8 #include <initguid.h> | 8 #include <initguid.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 | 10 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 if (!::ShellExecuteExW(&sei)) { | 139 if (!::ShellExecuteExW(&sei)) { |
| 140 int error = HRESULT_FROM_WIN32(::GetLastError()); | 140 int error = HRESULT_FROM_WIN32(::GetLastError()); |
| 141 AtlTrace("ShellExecute returned 0x%08X\n", error); | 141 AtlTrace("ShellExecute returned 0x%08X\n", error); |
| 142 return error; | 142 return error; |
| 143 } | 143 } |
| 144 } else { | 144 } else { |
| 145 base::FilePath chrome_exe_path; | 145 base::FilePath chrome_exe_path; |
| 146 bool found_exe = CommandExecuteImpl::FindChromeExe(&chrome_exe_path); | 146 bool found_exe = CommandExecuteImpl::FindChromeExe(&chrome_exe_path); |
| 147 DCHECK(found_exe); | 147 DCHECK(found_exe); |
| 148 if (found_exe) { | 148 if (found_exe) { |
| 149 bool launch_ash = CommandLine::ForCurrentProcess()->HasSwitch( | 149 bool launch_ash = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 150 switches::kForceImmersive); | 150 switches::kForceImmersive); |
| 151 if (launch_ash) { | 151 if (launch_ash) { |
| 152 AtlTrace(L"Relaunching Chrome into Windows ASH on Windows 7\n"); | 152 AtlTrace(L"Relaunching Chrome into Windows ASH on Windows 7\n"); |
| 153 } else { | 153 } else { |
| 154 AtlTrace(L"Relaunching Chrome into Desktop From ASH on Windows 7\n"); | 154 AtlTrace(L"Relaunching Chrome into Desktop From ASH on Windows 7\n"); |
| 155 } | 155 } |
| 156 SHELLEXECUTEINFO sei = { sizeof(sei) }; | 156 SHELLEXECUTEINFO sei = { sizeof(sei) }; |
| 157 sei.fMask = SEE_MASK_FLAG_LOG_USAGE; | 157 sei.fMask = SEE_MASK_FLAG_LOG_USAGE; |
| 158 sei.nShow = SW_SHOWNORMAL; | 158 sei.nShow = SW_SHOWNORMAL; |
| 159 // No point in using the shortcut if we are launching into ASH as any | 159 // No point in using the shortcut if we are launching into ASH as any |
| (...skipping 15 matching lines...) Expand all Loading... |
| 175 return S_OK; | 175 return S_OK; |
| 176 } | 176 } |
| 177 | 177 |
| 178 extern "C" int WINAPI _tWinMain(HINSTANCE , HINSTANCE, LPTSTR, int nShowCmd) { | 178 extern "C" int WINAPI _tWinMain(HINSTANCE , HINSTANCE, LPTSTR, int nShowCmd) { |
| 179 scoped_ptr<google_breakpad::ExceptionHandler> breakpad = | 179 scoped_ptr<google_breakpad::ExceptionHandler> breakpad = |
| 180 delegate_execute::InitializeCrashReporting(); | 180 delegate_execute::InitializeCrashReporting(); |
| 181 | 181 |
| 182 base::AtExitManager exit_manager; | 182 base::AtExitManager exit_manager; |
| 183 AtlTrace("delegate_execute enter\n"); | 183 AtlTrace("delegate_execute enter\n"); |
| 184 | 184 |
| 185 CommandLine::Init(0, NULL); | 185 base::CommandLine::Init(0, NULL); |
| 186 HRESULT ret_code = E_UNEXPECTED; | 186 HRESULT ret_code = E_UNEXPECTED; |
| 187 DelegateExecuteOperation operation; | 187 DelegateExecuteOperation operation; |
| 188 if (operation.Init(CommandLine::ForCurrentProcess())) { | 188 if (operation.Init(base::CommandLine::ForCurrentProcess())) { |
| 189 switch (operation.operation_type()) { | 189 switch (operation.operation_type()) { |
| 190 case DelegateExecuteOperation::DELEGATE_EXECUTE: | 190 case DelegateExecuteOperation::DELEGATE_EXECUTE: |
| 191 ret_code = _AtlModule.WinMain(nShowCmd); | 191 ret_code = _AtlModule.WinMain(nShowCmd); |
| 192 break; | 192 break; |
| 193 case DelegateExecuteOperation::RELAUNCH_CHROME: | 193 case DelegateExecuteOperation::RELAUNCH_CHROME: |
| 194 ret_code = RelaunchChrome(operation); | 194 ret_code = RelaunchChrome(operation); |
| 195 break; | 195 break; |
| 196 default: | 196 default: |
| 197 NOTREACHED(); | 197 NOTREACHED(); |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 AtlTrace("delegate_execute exit, code = %d\n", ret_code); | 200 AtlTrace("delegate_execute exit, code = %d\n", ret_code); |
| 201 return ret_code; | 201 return ret_code; |
| 202 } | 202 } |
| OLD | NEW |