summaryrefslogtreecommitdiffstats
path: root/win8/viewer/metro_viewer_process_host.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 00:04:59 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 00:04:59 +0000
commit45214559b6f71458336f00f850e02e43d3cd8415 (patch)
tree599c94853f179cbf614c043ae61ce6139005f483 /win8/viewer/metro_viewer_process_host.cc
parentb1e93abe8fe317771862c42652312bf36ac4b11a (diff)
downloadchromium_src-45214559b6f71458336f00f850e02e43d3cd8415.zip
chromium_src-45214559b6f71458336f00f850e02e43d3cd8415.tar.gz
chromium_src-45214559b6f71458336f00f850e02e43d3cd8415.tar.bz2
3rd part of porting Chrome Ash to Windows 7
This is the Chrome side that 1- removes windows 8 specific checks 2- disconnects the fake window_tree_host_win 3- connects the remote_window_tree_host_win With this change you can now see the ash desktop but not interact with it since input events have not been enabled. Here is the second part https://codereview.chromium.org/211863003/ First part with rationale: https://codereview.chromium.org/199843004/ Note: this is a redo & rebase of https://codereview.chromium.org/227573007/ BUG=356475 TEST=none patch from issue 235683005 BUG= Review URL: https://codereview.chromium.org/235933004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264680 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8/viewer/metro_viewer_process_host.cc')
-rw-r--r--win8/viewer/metro_viewer_process_host.cc32
1 files changed, 22 insertions, 10 deletions
diff --git a/win8/viewer/metro_viewer_process_host.cc b/win8/viewer/metro_viewer_process_host.cc
index a44ea3c..cb6a202 100644
--- a/win8/viewer/metro_viewer_process_host.cc
+++ b/win8/viewer/metro_viewer_process_host.cc
@@ -10,12 +10,14 @@
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
+#include "base/path_service.h"
#include "base/process/process.h"
#include "base/process/process_handle.h"
#include "base/strings/string16.h"
#include "base/synchronization/waitable_event.h"
#include "base/time/time.h"
#include "base/win/scoped_comptr.h"
+#include "base/win/windows_version.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
#include "ui/aura/remote_window_tree_host_win.h"
@@ -87,17 +89,27 @@ bool MetroViewerProcessHost::LaunchViewerAndWaitForConnection(
message_filter_ = new InternalMessageFilter(this);
channel_->AddFilter(message_filter_);
- base::win::ScopedComPtr<IApplicationActivationManager> activator;
- HRESULT hr = activator.CreateInstance(CLSID_ApplicationActivationManager);
- if (SUCCEEDED(hr)) {
- DWORD pid = 0;
- // Use the "connect" verb to
- hr = activator->ActivateApplication(
- app_user_model_id.c_str(), kMetroViewerConnectVerb, AO_NONE, &pid);
- }
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
+ base::win::ScopedComPtr<IApplicationActivationManager> activator;
+ HRESULT hr = activator.CreateInstance(CLSID_ApplicationActivationManager);
+ if (SUCCEEDED(hr)) {
+ DWORD pid = 0;
+ // Use the "connect" verb to
+ hr = activator->ActivateApplication(
+ app_user_model_id.c_str(), kMetroViewerConnectVerb, AO_NONE, &pid);
+ }
- LOG_IF(ERROR, FAILED(hr)) << "Tried and failed to launch Metro Chrome. "
- << "hr=" << std::hex << hr;
+ LOG_IF(ERROR, FAILED(hr)) << "Tried and failed to launch Metro Chrome. "
+ << "hr=" << std::hex << hr;
+ } else {
+ // For Windows 7 we need to launch the viewer ourselves.
+ base::FilePath chrome_path;
+ if (!PathService::Get(base::DIR_EXE, &chrome_path))
+ return false;
+ // TODO(cpu): launch with "-ServerName:DefaultBrowserServer"
+ // note that the viewer might try to launch chrome again.
+ CHECK(false);
+ }
// Having launched the viewer process, now we wait for it to connect.
bool success =