Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Unified Diff: win8/metro_driver/chrome_app_view_ash.cc

Issue 23592024: Make the metro viewer responsible for relaunching browser in desktop mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a few nits. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « win8/metro_driver/chrome_app_view_ash.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..206ea83efc1aa421851086011214d95bc9c447d2 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));
}
« no previous file with comments | « win8/metro_driver/chrome_app_view_ash.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698