diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-11 03:20:38 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-11 03:20:38 +0000 |
commit | a88d6293f77654d0c22c3f37d228ea5fa33daed8 (patch) | |
tree | 35b6a1d5953601c5f9f3302f1193c387fc87d7a3 /win8 | |
parent | 35835660ee6ea6bc7c95629804fc7a61321f8a3e (diff) | |
download | chromium_src-a88d6293f77654d0c22c3f37d228ea5fa33daed8.zip chromium_src-a88d6293f77654d0c22c3f37d228ea5fa33daed8.tar.gz chromium_src-a88d6293f77654d0c22c3f37d228ea5fa33daed8.tar.bz2 |
Make LaunchViewerAndWaitForConnection() always result in the viewer not trying to launch a browser process back.
scottmg did the necessary plumbing to make this true for ash_unittests (via "test_open"), but it should be true for all users of this path (i.e., currently that's only ash_unittests and browser_tests --ash-browsertests).
This CL also adds the 'metro_viewer_constants' target to avoid having to depend on the 'metro_viewer' target itself in various other targets.
BUG=286205
TEST=No more pipe errors on http://build.chromium.org/p/chromium.fyi/builders/Chromium%20Win%20Aura%20Ash%20(1)
Review URL: https://codereview.chromium.org/98853005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239992 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8')
-rw-r--r-- | win8/delegate_execute/command_execute_impl.cc | 3 | ||||
-rw-r--r-- | win8/delegate_execute/delegate_execute.gyp | 7 | ||||
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.cc | 5 | ||||
-rw-r--r-- | win8/metro_driver/metro_driver.gyp | 2 | ||||
-rw-r--r-- | win8/viewer/metro_viewer_constants.cc | 2 | ||||
-rw-r--r-- | win8/viewer/metro_viewer_constants.h | 4 | ||||
-rw-r--r-- | win8/viewer/metro_viewer_process_host.cc | 7 | ||||
-rw-r--r-- | win8/viewer/metro_viewer_process_host.h | 7 | ||||
-rw-r--r-- | win8/win8.gyp | 14 |
9 files changed, 35 insertions, 16 deletions
diff --git a/win8/delegate_execute/command_execute_impl.cc b/win8/delegate_execute/command_execute_impl.cc index f52037b..cb68f54 100644 --- a/win8/delegate_execute/command_execute_impl.cc +++ b/win8/delegate_execute/command_execute_impl.cc @@ -30,6 +30,7 @@ #include "ui/base/clipboard/clipboard_util_win.h" #include "win8/delegate_execute/chrome_util.h" #include "win8/delegate_execute/delegate_execute_util.h" +#include "win8/viewer/metro_viewer_constants.h" namespace { @@ -300,7 +301,7 @@ STDMETHODIMP CommandExecuteImpl::GetValue(enum AHE_TYPE* pahe) { } #if defined(USE_AURA) - if (*pahe == AHE_IMMERSIVE && verb_ != L"test_open") + if (*pahe == AHE_IMMERSIVE && verb_ != win8::kMetroViewerConnectVerb) LaunchChromeBrowserProcess(); #endif diff --git a/win8/delegate_execute/delegate_execute.gyp b/win8/delegate_execute/delegate_execute.gyp index 0307dc8..935534f 100644 --- a/win8/delegate_execute/delegate_execute.gyp +++ b/win8/delegate_execute/delegate_execute.gyp @@ -71,6 +71,13 @@ 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS }, }, + 'conditions': [ + ['use_aura==1', { + 'dependencies': [ + '../win8.gyp:metro_viewer_constants', + ], + }], + ], }, { 'target_name': 'delegate_execute_unittests', diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc index e6525d1..91eec0a 100644 --- a/win8/metro_driver/chrome_app_view_ash.cc +++ b/win8/metro_driver/chrome_app_view_ash.cc @@ -428,9 +428,8 @@ bool LaunchChromeBrowserProcess(const wchar_t* additional_parameters, mswrw::HString launch_args_str; launch_args->get_Arguments(launch_args_str.GetAddressOf()); string16 actual_launch_args(MakeStdWString(launch_args_str.Get())); - if (actual_launch_args == L"test_open") { - DVLOG(1) << __FUNCTION__ - << "Not launching chrome server"; + if (actual_launch_args == win8::kMetroViewerConnectVerb) { + DVLOG(1) << __FUNCTION__ << "Not launching chrome server"; return true; } } diff --git a/win8/metro_driver/metro_driver.gyp b/win8/metro_driver/metro_driver.gyp index 1b81a79..cc572d8 100644 --- a/win8/metro_driver/metro_driver.gyp +++ b/win8/metro_driver/metro_driver.gyp @@ -75,7 +75,7 @@ 'conditions': [ ['use_aura==1', { 'dependencies': [ - '../win8.gyp:metro_viewer', + '../win8.gyp:metro_viewer_constants', ], 'sources': [ 'chrome_app_view_ash.cc', diff --git a/win8/viewer/metro_viewer_constants.cc b/win8/viewer/metro_viewer_constants.cc index 578b22f..fd54fe4 100644 --- a/win8/viewer/metro_viewer_constants.cc +++ b/win8/viewer/metro_viewer_constants.cc @@ -8,4 +8,6 @@ namespace win8 { const char kMetroViewerIPCChannelName[] = "viewer"; +const wchar_t kMetroViewerConnectVerb[] = L"connect"; + } // namespace win8 diff --git a/win8/viewer/metro_viewer_constants.h b/win8/viewer/metro_viewer_constants.h index 249f96c..560a450 100644 --- a/win8/viewer/metro_viewer_constants.h +++ b/win8/viewer/metro_viewer_constants.h @@ -11,6 +11,10 @@ namespace win8 { // process. extern const char kMetroViewerIPCChannelName[]; +// Tells the viewer process to simply connect back without needing to launch a +// browser process itself. +extern const wchar_t kMetroViewerConnectVerb[]; + } // namespace win8 #endif // WIN8_VIEWER_METRO_VIEWER_CONSTANTS_H_ diff --git a/win8/viewer/metro_viewer_process_host.cc b/win8/viewer/metro_viewer_process_host.cc index 6a86ec9..6832dba 100644 --- a/win8/viewer/metro_viewer_process_host.cc +++ b/win8/viewer/metro_viewer_process_host.cc @@ -52,8 +52,7 @@ base::ProcessId MetroViewerProcessHost::GetViewerProcessId() { } bool MetroViewerProcessHost::LaunchViewerAndWaitForConnection( - const base::string16& app_user_model_id, - const base::string16& verb) { + const base::string16& app_user_model_id) { DCHECK_EQ(base::kNullProcessId, channel_->peer_pid()); channel_connected_event_.reset(new base::WaitableEvent(false, false)); @@ -66,9 +65,9 @@ bool MetroViewerProcessHost::LaunchViewerAndWaitForConnection( HRESULT hr = activator.CreateInstance(CLSID_ApplicationActivationManager); if (SUCCEEDED(hr)) { DWORD pid = 0; - base::string16 actual_verb = verb.empty() ? L"open" : verb; + // Use the "connect" verb to hr = activator->ActivateApplication( - app_user_model_id.c_str(), actual_verb.c_str(), AO_NONE, &pid); + app_user_model_id.c_str(), kMetroViewerConnectVerb, AO_NONE, &pid); } LOG_IF(ERROR, FAILED(hr)) << "Tried and failed to launch Metro Chrome. " diff --git a/win8/viewer/metro_viewer_process_host.h b/win8/viewer/metro_viewer_process_host.h index 635caae..ad034ad 100644 --- a/win8/viewer/metro_viewer_process_host.h +++ b/win8/viewer/metro_viewer_process_host.h @@ -48,12 +48,9 @@ class MetroViewerProcessHost : public IPC::Listener, // and blocks until that viewer process connects or until a timeout is // reached. Returns true if the viewer process connects before the timeout is // reached. NOTE: this assumes that the app referred to by |app_user_model_id| - // is registered as the default browser. |verb| can be customized for - // testing (test_open will cause the viewer not to launch chrome), and if - // it's empty it will be replaced by "open". + // is registered as the default browser. bool LaunchViewerAndWaitForConnection( - const base::string16& app_user_model_id, - const base::string16& verb); + const base::string16& app_user_model_id); private: // IPC::Sender implementation: diff --git a/win8/win8.gyp b/win8/win8.gyp index 00bfa3b..dc73584 100644 --- a/win8/win8.gyp +++ b/win8/win8.gyp @@ -51,6 +51,17 @@ ], }, { + 'target_name': 'metro_viewer_constants', + 'type': 'static_library', + 'include_dirs': [ + '..', + ], + 'sources': [ + 'viewer/metro_viewer_constants.cc', + 'viewer/metro_viewer_constants.h', + ], + }, + { 'target_name': 'metro_viewer', 'type': 'static_library', 'dependencies': [ @@ -58,10 +69,9 @@ '../ipc/ipc.gyp:ipc', '../ui/aura/aura.gyp:aura', '../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages', + 'metro_viewer_constants' ], 'sources': [ - 'viewer/metro_viewer_constants.cc', - 'viewer/metro_viewer_constants.h', 'viewer/metro_viewer_process_host.cc', 'viewer/metro_viewer_process_host.h', ], |