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 // Implementation of the CommandExecuteImpl class which implements the | 4 // Implementation of the CommandExecuteImpl class which implements the |
5 // IExecuteCommand and related interfaces for handling ShellExecute based | 5 // IExecuteCommand and related interfaces for handling ShellExecute based |
6 // launches of the Chrome browser. | 6 // launches of the Chrome browser. |
7 | 7 |
8 #include "win8/delegate_execute/command_execute_impl.h" | 8 #include "win8/delegate_execute/command_execute_impl.h" |
9 | 9 |
10 #include <shlguid.h> | 10 #include <shlguid.h> |
11 | 11 |
12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/process/launch.h" | 14 #include "base/process/launch.h" |
15 #include "base/process/process_handle.h" | |
16 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
17 #include "base/win/message_window.h" | 16 #include "base/win/message_window.h" |
18 #include "base/win/registry.h" | 17 #include "base/win/registry.h" |
19 #include "base/win/scoped_co_mem.h" | 18 #include "base/win/scoped_co_mem.h" |
20 #include "base/win/scoped_handle.h" | 19 #include "base/win/scoped_handle.h" |
21 #include "base/win/scoped_process_information.h" | 20 #include "base/win/scoped_process_information.h" |
22 #include "base/win/win_util.h" | 21 #include "base/win/win_util.h" |
23 #include "chrome/common/chrome_constants.h" | 22 #include "chrome/common/chrome_constants.h" |
24 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
25 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 IPropertyBag* bag) { | 279 IPropertyBag* bag) { |
281 if (!FindChromeExe(&chrome_exe_)) | 280 if (!FindChromeExe(&chrome_exe_)) |
282 return E_FAIL; | 281 return E_FAIL; |
283 delegate_execute::UpdateChromeIfNeeded(chrome_exe_); | 282 delegate_execute::UpdateChromeIfNeeded(chrome_exe_); |
284 | 283 |
285 if (name) { | 284 if (name) { |
286 AtlTrace("Verb is %S\n", name); | 285 AtlTrace("Verb is %S\n", name); |
287 verb_ = name; | 286 verb_ = name; |
288 } | 287 } |
289 | 288 |
290 base::GetProcessIntegrityLevel(base::GetCurrentProcessHandle(), | 289 integrity_level_ = base::GetCurrentProcessIntegrityLevel(); |
291 &integrity_level_); | |
292 return S_OK; | 290 return S_OK; |
293 } | 291 } |
294 | 292 |
295 STDMETHODIMP CommandExecuteImpl::SetSelection(IShellItemArray* item_array) { | 293 STDMETHODIMP CommandExecuteImpl::SetSelection(IShellItemArray* item_array) { |
296 item_array_ = item_array; | 294 item_array_ = item_array; |
297 return S_OK; | 295 return S_OK; |
298 } | 296 } |
299 | 297 |
300 STDMETHODIMP CommandExecuteImpl::GetSelection(REFIID riid, void** selection) { | 298 STDMETHODIMP CommandExecuteImpl::GetSelection(REFIID riid, void** selection) { |
301 return S_OK; | 299 return S_OK; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 AtlTrace("Invalid registry launch mode value %u\n", reg_value); | 492 AtlTrace("Invalid registry launch mode value %u\n", reg_value); |
495 launch_mode = ECHUIM_DESKTOP; | 493 launch_mode = ECHUIM_DESKTOP; |
496 } else { | 494 } else { |
497 launch_mode = static_cast<EC_HOST_UI_MODE>(reg_value); | 495 launch_mode = static_cast<EC_HOST_UI_MODE>(reg_value); |
498 AtlTrace("Launch mode forced by registry to %s\n", modes[launch_mode]); | 496 AtlTrace("Launch mode forced by registry to %s\n", modes[launch_mode]); |
499 } | 497 } |
500 | 498 |
501 launch_mode_determined = true; | 499 launch_mode_determined = true; |
502 return launch_mode; | 500 return launch_mode; |
503 } | 501 } |
OLD | NEW |