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

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

Issue 10962023: Prefix Chrome switches with the switch prefix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | win8/delegate_execute/delegate_execute_operation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #include "base/at_exit.h" 11 #include "base/at_exit.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/file_util.h" 13 #include "base/file_util.h"
14 #include "base/process_util.h" 14 #include "base/process_util.h"
15 #include "base/string16.h" 15 #include "base/string16.h"
16 #include "base/utf_string_conversions.h"
17 #include "base/win/scoped_com_initializer.h" 16 #include "base/win/scoped_com_initializer.h"
18 #include "base/win/scoped_handle.h" 17 #include "base/win/scoped_handle.h"
19 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
20 #include "command_execute_impl.h" 19 #include "command_execute_impl.h"
21 #include "win8/delegate_execute/delegate_execute_operation.h" 20 #include "win8/delegate_execute/delegate_execute_operation.h"
22 #include "win8/delegate_execute/resource.h" 21 #include "win8/delegate_execute/resource.h"
23 22
24 using namespace ATL; 23 using namespace ATL;
25 24
26 class DelegateExecuteModule 25 class DelegateExecuteModule
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } else { 77 } else {
79 AtlTrace("Failed to wait for relaunch mutex, result is 0x%x\n", result); 78 AtlTrace("Failed to wait for relaunch mutex, result is 0x%x\n", result);
80 } 79 }
81 } else { 80 } else {
82 // It is possible that chrome exits so fast that the mutex is not there. 81 // It is possible that chrome exits so fast that the mutex is not there.
83 AtlTrace("No relaunch mutex found\n"); 82 AtlTrace("No relaunch mutex found\n");
84 } 83 }
85 84
86 base::win::ScopedCOMInitializer com_initializer; 85 base::win::ScopedCOMInitializer com_initializer;
87 86
88 string16 flags(ASCIIToWide(operation.relaunch_flags()));
89 SHELLEXECUTEINFO sei = { sizeof(sei) }; 87 SHELLEXECUTEINFO sei = { sizeof(sei) };
90 sei.fMask = SEE_MASK_FLAG_LOG_USAGE; 88 sei.fMask = SEE_MASK_FLAG_LOG_USAGE;
91 sei.nShow = SW_SHOWNORMAL; 89 sei.nShow = SW_SHOWNORMAL;
92 sei.lpFile = operation.shortcut().value().c_str(); 90 sei.lpFile = operation.shortcut().value().c_str();
93 sei.lpParameters = flags.c_str(); 91 sei.lpParameters = operation.relaunch_flags().c_str();
cpu_(ooo_6.6-7.5) 2012/09/21 19:28:01 this is fine but note that my version is defensive
94 92
95 AtlTrace(L"Relaunching Chrome via shortcut [%ls]\n", sei.lpFile); 93 AtlTrace(L"Relaunching Chrome via shortcut [%ls]\n", sei.lpFile);
96 94
97 if (!::ShellExecuteExW(&sei)) { 95 if (!::ShellExecuteExW(&sei)) {
98 int error = HRESULT_FROM_WIN32(::GetLastError()); 96 int error = HRESULT_FROM_WIN32(::GetLastError());
99 AtlTrace("ShellExecute returned 0x%08X\n", error); 97 AtlTrace("ShellExecute returned 0x%08X\n", error);
100 return error; 98 return error;
101 } 99 }
102 return S_OK; 100 return S_OK;
103 } 101 }
(...skipping 13 matching lines...) Expand all
117 case DelegateExecuteOperation::RELAUNCH_CHROME: 115 case DelegateExecuteOperation::RELAUNCH_CHROME:
118 ret_code = RelaunchChrome(operation); 116 ret_code = RelaunchChrome(operation);
119 break; 117 break;
120 default: 118 default:
121 NOTREACHED(); 119 NOTREACHED();
122 } 120 }
123 } 121 }
124 AtlTrace("delegate_execute exit, code = %d\n", ret_code); 122 AtlTrace("delegate_execute exit, code = %d\n", ret_code);
125 return ret_code; 123 return ret_code;
126 } 124 }
OLDNEW
« no previous file with comments | « no previous file | win8/delegate_execute/delegate_execute_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698