diff options
author | Torne (Richard Coles) <torne@google.com> | 2013-09-12 12:10:22 +0100 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2013-09-12 12:10:22 +0100 |
commit | 58537e28ecd584eab876aee8be7156509866d23a (patch) | |
tree | 8988984e52090aaadf33cff139d7dd212cd13656 /win8 | |
parent | 0a1b11dee8e5cb2520121c300858fea6138e3c54 (diff) | |
download | chromium_org-58537e28ecd584eab876aee8be7156509866d23a.tar.gz |
Merge from Chromium at DEPS revision 222756
This commit was generated by merge_to_master.py.
Change-Id: I40d7f32f195f328f005f230ea80d07092d48040e
Diffstat (limited to 'win8')
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.cc | 23 | ||||
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.h | 10 |
2 files changed, 30 insertions, 3 deletions
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc index 8686b53c39..206ea83efc 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) { + base::FilePath::StringType file = shortcut.value(); + 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); +} + void ChromeAppViewAsh::OnSetCursor(HCURSOR cursor) { ::SetCursor(HCURSOR(cursor)); } diff --git a/win8/metro_driver/chrome_app_view_ash.h b/win8/metro_driver/chrome_app_view_ash.h index 57f20b95c4..62f0476e82 100644 --- a/win8/metro_driver/chrome_app_view_ash.h +++ b/win8/metro_driver/chrome_app_view_ash.h @@ -10,16 +10,19 @@ #include <windows.ui.input.h> #include <windows.ui.viewmanagement.h> -#include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/strings/string16.h" #include "ui/base/events/event_constants.h" #include "win8/metro_driver/direct3d_helper.h" +namespace base { +class FilePath; +} + namespace IPC { - class Listener; - class ChannelProxy; +class Listener; +class ChannelProxy; } class OpenFilePickerSession; @@ -46,6 +49,7 @@ class ChromeAppViewAsh // Returns S_OK on success. static HRESULT Unsnap(); + void OnOpenURLOnDesktop(const base::FilePath& shortcut, const string16& url); void OnSetCursor(HCURSOR cursor); void OnDisplayFileOpenDialog(const string16& title, const string16& filter, |