| 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> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/win/scoped_process_information.h" | 21 #include "base/win/scoped_process_information.h" |
| 22 #include "base/win/win_util.h" | 22 #include "base/win/win_util.h" |
| 23 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
| 24 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
| 25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/installer/util/browser_distribution.h" | 26 #include "chrome/installer/util/browser_distribution.h" |
| 27 #include "chrome/installer/util/install_util.h" | 27 #include "chrome/installer/util/install_util.h" |
| 28 #include "chrome/installer/util/shell_util.h" | 28 #include "chrome/installer/util/shell_util.h" |
| 29 #include "chrome/installer/util/util_constants.h" | 29 #include "chrome/installer/util/util_constants.h" |
| 30 #include "ui/base/clipboard/clipboard_util_win.h" | 30 #include "ui/base/clipboard/clipboard_util_win.h" |
| 31 #include "ui/base/ui_base_switches.h" |
| 31 #include "ui/gfx/win/dpi.h" | 32 #include "ui/gfx/win/dpi.h" |
| 32 #include "win8/delegate_execute/chrome_util.h" | 33 #include "win8/delegate_execute/chrome_util.h" |
| 33 #include "win8/delegate_execute/delegate_execute_util.h" | 34 #include "win8/delegate_execute/delegate_execute_util.h" |
| 34 #include "win8/viewer/metro_viewer_constants.h" | 35 #include "win8/viewer/metro_viewer_constants.h" |
| 35 | 36 |
| 36 namespace { | 37 namespace { |
| 37 // Helper function to retrieve the url from IShellItem interface passed in. | 38 // Helper function to retrieve the url from IShellItem interface passed in. |
| 38 // Returns S_OK on success. | 39 // Returns S_OK on success. |
| 39 HRESULT GetUrlFromShellItem(IShellItem* shell_item, base::string16* url) { | 40 HRESULT GetUrlFromShellItem(IShellItem* shell_item, base::string16* url) { |
| 40 DCHECK(shell_item); | 41 DCHECK(shell_item); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // 7- Windows calls CommandExecuteImpl::Execute() | 148 // 7- Windows calls CommandExecuteImpl::Execute() |
| 148 // Here we call GetLaunchMode() which returns the cached answer | 149 // Here we call GetLaunchMode() which returns the cached answer |
| 149 // computed at step 5c. which can be: | 150 // computed at step 5c. which can be: |
| 150 // a) ECHUIM_DESKTOP then we call LaunchDesktopChrome() that calls | 151 // a) ECHUIM_DESKTOP then we call LaunchDesktopChrome() that calls |
| 151 // ::CreateProcess and we exit at this point even on failure. | 152 // ::CreateProcess and we exit at this point even on failure. |
| 152 // b) else we call one of the IApplicationActivationManager activation | 153 // b) else we call one of the IApplicationActivationManager activation |
| 153 // functions depending on the parameters passed in step 4. | 154 // functions depending on the parameters passed in step 4. |
| 154 // c) If the activation returns E_APPLICATION_NOT_REGISTERED, then we fall | 155 // c) If the activation returns E_APPLICATION_NOT_REGISTERED, then we fall |
| 155 // back to launching chrome on the desktop via LaunchDestopChrome(). Note | 156 // back to launching chrome on the desktop via LaunchDestopChrome(). Note |
| 156 // that this case can lead to strange behavior, because at this point we | 157 // that this case can lead to strange behavior, because at this point we |
| 157 // have pre-launched the browser with --silent-launch --viewer-connect. | 158 // have pre-launched the browser with: |
| 159 // --silent-launch --connect-to-metro-viewer. |
| 158 // E_APPLICATION_NOT_REGISTERED is always returned if Chrome is not the | 160 // E_APPLICATION_NOT_REGISTERED is always returned if Chrome is not the |
| 159 // default browser (this case will have already been checked for by | 161 // default browser (this case will have already been checked for by |
| 160 // GetLaunchMode() and AHE_DESKTOP returned), but we don't know if it can | 162 // GetLaunchMode() and AHE_DESKTOP returned), but we don't know if it can |
| 161 // be returned for other reasons. | 163 // be returned for other reasons. |
| 162 // | 164 // |
| 163 // Note that if a command line --force-xxx is present we write that launch mode | 165 // Note that if a command line --force-xxx is present we write that launch mode |
| 164 // in the registry so next time the logic reaches 5c-ii it will use the same | 166 // in the registry so next time the logic reaches 5c-ii it will use the same |
| 165 // mode again. | 167 // mode again. |
| 166 // | 168 // |
| 167 CommandExecuteImpl::CommandExecuteImpl() | 169 CommandExecuteImpl::CommandExecuteImpl() |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 AtlTrace("Invalid registry launch mode value %u\n", reg_value); | 496 AtlTrace("Invalid registry launch mode value %u\n", reg_value); |
| 495 launch_mode = ECHUIM_DESKTOP; | 497 launch_mode = ECHUIM_DESKTOP; |
| 496 } else { | 498 } else { |
| 497 launch_mode = static_cast<EC_HOST_UI_MODE>(reg_value); | 499 launch_mode = static_cast<EC_HOST_UI_MODE>(reg_value); |
| 498 AtlTrace("Launch mode forced by registry to %s\n", modes[launch_mode]); | 500 AtlTrace("Launch mode forced by registry to %s\n", modes[launch_mode]); |
| 499 } | 501 } |
| 500 | 502 |
| 501 launch_mode_determined = true; | 503 launch_mode_determined = true; |
| 502 return launch_mode; | 504 return launch_mode; |
| 503 } | 505 } |
| OLD | NEW |