Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: win8/delegate_execute/delegate_execute.cc

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « win8/delegate_execute/command_execute_impl.cc ('k') | win8/delegate_execute/delegate_execute_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698