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

Unified Diff: win8/viewer/metro_viewer_process_host.cc

Issue 235933004: 3rd part of porting Chrome Ash to Windows 7 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ash_unittests fixes Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « win8/metro_driver/metro_driver_win7.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/viewer/metro_viewer_process_host.cc
diff --git a/win8/viewer/metro_viewer_process_host.cc b/win8/viewer/metro_viewer_process_host.cc
index a44ea3c473ae74ad8a0ac6a6f30c142439abd666..cb6a20264da7d3fa2962d0d573a10b20e4421d7f 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 =
« no previous file with comments | « win8/metro_driver/metro_driver_win7.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698