Chromium Code Reviews| Index: win8/metro_driver/chrome_app_view_ash.cc |
| diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc |
| index 8686b53c3930d5fbd348e4f5e919d8bd9d523b8c..2374b40fb8034f7cba11d70c7c2a22e5b6836ba1 100644 |
| --- a/win8/metro_driver/chrome_app_view_ash.cc |
| +++ b/win8/metro_driver/chrome_app_view_ash.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/bind.h" |
| #include "base/command_line.h" |
| +#include "base/files/file_path.h" |
| #include "base/message_loop/message_loop.h" |
| #include "base/path_service.h" |
| #include "base/threading/thread.h" |
| @@ -83,6 +84,8 @@ class ChromeChannelListener : public IPC::Listener { |
| virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { |
| IPC_BEGIN_MESSAGE_MAP(ChromeChannelListener, message) |
| + IPC_MESSAGE_HANDLER(MetroViewerHostMsg_OpenURLOnDesktop, |
| + OnOpenURLOnDesktop) |
| IPC_MESSAGE_HANDLER(MetroViewerHostMsg_SetCursor, OnSetCursor) |
| IPC_MESSAGE_HANDLER(MetroViewerHostMsg_DisplayFileOpen, |
| OnDisplayFileOpenDialog) |
| @@ -102,6 +105,14 @@ class ChromeChannelListener : public IPC::Listener { |
| } |
| private: |
| + void OnOpenURLOnDesktop(const base::FilePath& shortcut, |
| + const string16& url) { |
| + ui_proxy_->PostTask(FROM_HERE, |
| + base::Bind(&ChromeAppViewAsh::OnOpenURLOnDesktop, |
| + base::Unretained(app_view_), |
| + shortcut, url)); |
| + } |
| + |
| void OnSetCursor(int64 cursor) { |
| ui_proxy_->PostTask(FROM_HERE, |
| base::Bind(&ChromeAppViewAsh::OnSetCursor, |
| @@ -502,6 +513,18 @@ HRESULT ChromeAppViewAsh::Unsnap() { |
| } |
| +void ChromeAppViewAsh::OnOpenURLOnDesktop(const base::FilePath& shortcut, |
| + const string16& url) { |
| + string16 file = shortcut.AsUTF16Unsafe(); |
|
Bernhard Bauer
2013/08/31 10:15:05
You could probably use FilePath::StringType here.
|
| + SHELLEXECUTEINFO sei = { sizeof(sei) }; |
| + sei.fMask = SEE_MASK_FLAG_LOG_USAGE; |
| + sei.nShow = SW_SHOWNORMAL; |
| + sei.lpFile = file.c_str(); |
| + sei.lpDirectory = L""; |
| + sei.lpParameters = url.c_str(); |
| + BOOL result = ShellExecuteEx(&sei); |
|
cpu_(ooo_6.6-7.5)
2013/09/03 17:55:12
who knows what COM apartment this thread has... bu
|
| +} |
| + |
| void ChromeAppViewAsh::OnSetCursor(HCURSOR cursor) { |
| ::SetCursor(HCURSOR(cursor)); |
| } |