| 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/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/process/launch.h" | 15 #include "base/process/launch.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/win/metro.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 "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
| 24 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
| 25 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
| 26 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/installer/util/browser_distribution.h" | 26 #include "chrome/installer/util/browser_distribution.h" |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 return launch_mode; | 479 return launch_mode; |
| 481 } | 480 } |
| 482 | 481 |
| 483 if (launch_mode_determined) { | 482 if (launch_mode_determined) { |
| 484 AtlTrace("Launch mode forced by cmdline to %s\n", modes[launch_mode]); | 483 AtlTrace("Launch mode forced by cmdline to %s\n", modes[launch_mode]); |
| 485 reg_key.WriteValue(chrome::kLaunchModeValue, | 484 reg_key.WriteValue(chrome::kLaunchModeValue, |
| 486 static_cast<DWORD>(launch_mode)); | 485 static_cast<DWORD>(launch_mode)); |
| 487 return launch_mode; | 486 return launch_mode; |
| 488 } | 487 } |
| 489 | 488 |
| 490 if (!base::win::IsChromeMetroSupported()) { | 489 launch_mode = ECHUIM_DESKTOP; |
| 491 launch_mode = ECHUIM_DESKTOP; | |
| 492 launch_mode_determined = true; | |
| 493 return launch_mode; | |
| 494 } | |
| 495 | |
| 496 // Use the previous mode if available. Else launch in desktop mode. | |
| 497 DWORD reg_value; | |
| 498 if (reg_key.ReadValueDW(chrome::kLaunchModeValue, | |
| 499 ®_value) != ERROR_SUCCESS) { | |
| 500 launch_mode = ECHUIM_DESKTOP; | |
| 501 AtlTrace("Can't read registry, defaulting to %s\n", modes[launch_mode]); | |
| 502 } else if (reg_value >= ECHUIM_SYSTEM_LAUNCHER) { | |
| 503 AtlTrace("Invalid registry launch mode value %u\n", reg_value); | |
| 504 launch_mode = ECHUIM_DESKTOP; | |
| 505 } else { | |
| 506 launch_mode = static_cast<EC_HOST_UI_MODE>(reg_value); | |
| 507 AtlTrace("Launch mode forced by registry to %s\n", modes[launch_mode]); | |
| 508 } | |
| 509 | |
| 510 launch_mode_determined = true; | 490 launch_mode_determined = true; |
| 511 return launch_mode; | 491 return launch_mode; |
| 512 } | 492 } |
| OLD | NEW |