summaryrefslogtreecommitdiffstats
path: root/win8/metro_driver
diff options
context:
space:
mode:
authorshrikant@chromium.org <shrikant@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-31 15:22:00 +0000
committershrikant@chromium.org <shrikant@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-31 15:22:00 +0000
commitd51373d3f34d05fae96940a523da2383b2261c33 (patch)
treed140f70b9c041ef9d0fa48c1281cc04ddbb87ee6 /win8/metro_driver
parent976e3c3f915b8c770be97fa61a7f42e2f26a93b2 (diff)
downloadchromium_src-d51373d3f34d05fae96940a523da2383b2261c33.zip
chromium_src-d51373d3f34d05fae96940a523da2383b2261c33.tar.gz
chromium_src-d51373d3f34d05fae96940a523da2383b2261c33.tar.bz2
Adding relaunch menu to Windows 8 Aura code. We expect following transitions with new menu:
1. When in desktop mode, you should see "Relaunch Chrome in Windows 8 mode", if clicked it will kill current browser process and relaunches all open tabs in Windows 8 mode. 2. When in Windows 8 mode, menu is "Relaunch Chrome in desktop mode", if clicked it will kill current browser process (gets user out of Ash shell) and relaunches all tabs in desktop mode. Once we select to launch in different mode through these menu items we store new mode in registry and use this mode as default mode for next time launch. This means even if you click on desktop icon and last mode stored is metro, user will be switched to metro mode. BUG=280823 R=cpu@chromium.org, jschuh@chromium.org, sky@chromium.org, ananta, cpu Review URL: https://codereview.chromium.org/32843009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8/metro_driver')
-rw-r--r--win8/metro_driver/chrome_app_view_ash.cc26
-rw-r--r--win8/metro_driver/chrome_app_view_ash.h1
2 files changed, 27 insertions, 0 deletions
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,