diff options
Diffstat (limited to 'win8')
-rw-r--r-- | win8/delegate_execute/command_execute_impl.cc | 32 | ||||
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.cc | 26 | ||||
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.h | 1 |
3 files changed, 27 insertions, 32 deletions
diff --git a/win8/delegate_execute/command_execute_impl.cc b/win8/delegate_execute/command_execute_impl.cc index 463bbb7..0a9fbcc 100644 --- a/win8/delegate_execute/command_execute_impl.cc +++ b/win8/delegate_execute/command_execute_impl.cc @@ -529,38 +529,6 @@ EC_HOST_UI_MODE CommandExecuteImpl::GetLaunchMode() { parameters_ = CommandLine(CommandLine::NO_PROGRAM); } -#if defined(USE_AURA) - if (launch_mode_determined) - return launch_mode; - - CComPtr<IExecuteCommandHost> host; - CComQIPtr<IServiceProvider> service_provider = m_spUnkSite; - if (service_provider) { - service_provider->QueryService(IID_IExecuteCommandHost, &host); - if (host) { - host->GetUIMode(&launch_mode); - } - } - - // According to 'developing metro style enabled desktop browser' document - // ECHUIM_SYSTEM_LAUNCHER – Start menu launch (includes Tile activation, - // typing a URL into the search box in Start, etc.) - // In non aura world we apparently used ECHUIM_SYSTEM_LAUNCHER to mean - // launch on desktop. For Aura we are changing ECHUIM_SYSTEM to mean - // immersive mode. - if (launch_mode == ECHUIM_SYSTEM_LAUNCHER) - launch_mode = ECHUIM_IMMERSIVE; - else if (launch_mode > ECHUIM_SYSTEM_LAUNCHER) { - // At the end if launch mode is not proper apply heuristics. - launch_mode = base::win::IsTouchEnabledDevice() ? - ECHUIM_IMMERSIVE : ECHUIM_DESKTOP; - } - - AtlTrace("Launching mode is %d\n", launch_mode); - launch_mode_determined = true; - return launch_mode; -#endif - base::win::RegKey reg_key; LONG key_result = reg_key.Create(HKEY_CURRENT_USER, chrome::kMetroRegistryPath, diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc index b795b92..7dd7d39 100644 --- a/win8/metro_driver/chrome_app_view_ash.cc +++ b/win8/metro_driver/chrome_app_view_ash.cc @@ -81,6 +81,8 @@ class ChromeChannelListener : public IPC::Listener { virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { IPC_BEGIN_MESSAGE_MAP(ChromeChannelListener, message) + IPC_MESSAGE_HANDLER(MetroViewerHostMsg_ActivateDesktop, + OnActivateDesktop) IPC_MESSAGE_HANDLER(MetroViewerHostMsg_OpenURLOnDesktop, OnOpenURLOnDesktop) IPC_MESSAGE_HANDLER(MetroViewerHostMsg_SetCursor, OnSetCursor) @@ -102,6 +104,13 @@ class ChromeChannelListener : public IPC::Listener { } private: + void OnActivateDesktop(const base::FilePath& shortcut) { + ui_proxy_->PostTask(FROM_HERE, + base::Bind(&ChromeAppViewAsh::OnActivateDesktop, + base::Unretained(app_view_), + shortcut)); + } + void OnOpenURLOnDesktop(const base::FilePath& shortcut, const string16& url) { ui_proxy_->PostTask(FROM_HERE, @@ -524,6 +533,23 @@ HRESULT ChromeAppViewAsh::Unsnap() { return hr; } +void ChromeAppViewAsh::OnActivateDesktop(const base::FilePath& file_path) { + DLOG(INFO) << "ChannelAppViewAsh::OnActivateDesktop\n"; + // We are just executing delegate_execute here without parameters. Assumption + // here is that this process will be reused by shell when asking for + // IExecuteCommand interface. + + // TODO(shrikant): Consolidate ShellExecuteEx with SEE_MASK_FLAG_LOG_USAGE + // and place it metro.h or similar accessible file from all code code paths + // using this function. + SHELLEXECUTEINFO sei = { sizeof(sei) }; + sei.fMask = SEE_MASK_FLAG_LOG_USAGE; + sei.nShow = SW_SHOWNORMAL; + sei.lpFile = file_path.value().c_str(); + sei.lpParameters = NULL; + ::ShellExecuteExW(&sei); + ui_channel_->Send(new MetroViewerHostMsg_ActivateDesktopDone()); +} void ChromeAppViewAsh::OnOpenURLOnDesktop(const base::FilePath& shortcut, const string16& url) { diff --git a/win8/metro_driver/chrome_app_view_ash.h b/win8/metro_driver/chrome_app_view_ash.h index 0f9a14a..b301b3a 100644 --- a/win8/metro_driver/chrome_app_view_ash.h +++ b/win8/metro_driver/chrome_app_view_ash.h @@ -49,6 +49,7 @@ class ChromeAppViewAsh // Returns S_OK on success. static HRESULT Unsnap(); + void OnActivateDesktop(const base::FilePath& file_path); void OnOpenURLOnDesktop(const base::FilePath& shortcut, const string16& url); void OnSetCursor(HCURSOR cursor); void OnDisplayFileOpenDialog(const string16& title, |