diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-20 18:28:06 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-20 18:28:06 +0000 |
commit | 560cfc359cbaad9af3100542fe5b83fefe78f83f (patch) | |
tree | 38f1f3289354892343459950d1371f70bc27d95a /win8 | |
parent | ecdd3ec56717f8918384112697de3b0452015767 (diff) | |
download | chromium_src-560cfc359cbaad9af3100542fe5b83fefe78f83f.zip chromium_src-560cfc359cbaad9af3100542fe5b83fefe78f83f.tar.gz chromium_src-560cfc359cbaad9af3100542fe5b83fefe78f83f.tar.bz2 |
Launch the chrome browser process with the silent-launch and viewer-connect arguments from the metro driver on startup.
This is ok, because the command line processing code handles multiple requests to launch the viewer connection process
and ensures that there is only one channel created.
This handles the case where chrome is forcibly terminated on the desktop via Exit or a crash. Clicking on the metro chrome
tile which shows up at the top left should relaunch chrome ASH. This should also fix the search charm on Windows 8.
BUG=288033
R=cpu@chromium.org, cpu
Review URL: https://codereview.chromium.org/23464072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8')
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.cc | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc index 206ea83..7520589 100644 --- a/win8/metro_driver/chrome_app_view_ash.cc +++ b/win8/metro_driver/chrome_app_view_ash.cc @@ -305,6 +305,26 @@ uint32 GetKeyboardEventFlags() { return flags; } +bool LaunchChromeBrowserProcess (const wchar_t* additional_parameters) { + DVLOG(1) << "Launching chrome server"; + base::FilePath chrome_exe_path; + + if (!PathService::Get(base::FILE_EXE, &chrome_exe_path)) + return false; + + string16 parameters = L"--silent-launch --viewer-connect "; + if (additional_parameters) + parameters += additional_parameters; + + SHELLEXECUTEINFO sei = { sizeof(sei) }; + sei.nShow = SW_SHOWNORMAL; + sei.lpFile = chrome_exe_path.value().c_str(); + sei.lpDirectory = L""; + sei.lpParameters = parameters.c_str(); + ::ShellExecuteEx(&sei); + return true; +} + } // namespace ChromeAppViewAsh::ChromeAppViewAsh() @@ -638,10 +658,14 @@ HRESULT ChromeAppViewAsh::OnActivate( winapp::Activation::ActivationKind activation_kind; CheckHR(args->get_Kind(&activation_kind)); + DVLOG(1) << "Activation kind: " << activation_kind; + if (activation_kind == winapp::Activation::ActivationKind_Search) HandleSearchRequest(args); else if (activation_kind == winapp::Activation::ActivationKind_Protocol) HandleProtocolRequest(args); + else + LaunchChromeBrowserProcess(NULL); // We call ICoreWindow::Activate after the handling for the search/protocol // requests because Chrome can be launched to handle a search request which // in turn launches the chrome browser process in desktop mode via @@ -886,18 +910,7 @@ HRESULT ChromeAppViewAsh::HandleSearchRequest( if (!ui_channel_) { DVLOG(1) << "Launched to handle search request"; - base::FilePath chrome_exe_path; - - if (!PathService::Get(base::FILE_EXE, &chrome_exe_path)) - return E_FAIL; - - SHELLEXECUTEINFO sei = { sizeof(sei) }; - sei.nShow = SW_SHOWNORMAL; - sei.lpFile = chrome_exe_path.value().c_str(); - sei.lpDirectory = L""; - sei.lpParameters = - L"--silent-launch --viewer-connection=viewer --windows8-search"; - ::ShellExecuteEx(&sei); + LaunchChromeBrowserProcess(L"--windows8-search"); } mswrw::HString search_string; |