Index: chrome/browser/apps/chrome_apps_client.cc |
diff --git a/chrome/browser/apps/chrome_apps_client.cc b/chrome/browser/apps/chrome_apps_client.cc |
index 4a9f4cad63c8c8bfeebdc26362ca7faa6cf725fc..1f33851a033489fad374685436315e1b3698304d 100644 |
--- a/chrome/browser/apps/chrome_apps_client.cc |
+++ b/chrome/browser/apps/chrome_apps_client.cc |
@@ -7,6 +7,12 @@ |
#include "base/memory/singleton.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/profiles/profile_manager.h" |
+#include "chrome/browser/ui/apps/app_metro_infobar_delegate_win.h" |
+#include "chrome/common/extensions/extension.h" |
+ |
+#if defined(OS_WIN) |
+#include "win8/util/win8_util.h" |
+#endif |
ChromeAppsClient::ChromeAppsClient() {} |
@@ -25,3 +31,19 @@ std::vector<content::BrowserContext*> |
return std::vector<content::BrowserContext*>(profiles.begin(), |
profiles.end()); |
} |
+ |
+bool ChromeAppsClient::CheckAppLaunch(content::BrowserContext* context, |
+ const extensions::Extension* extension) { |
+#if defined(OS_WIN) |
+ // On Windows 8's single window Metro mode we can not launch platform apps. |
+ // Offer to switch Chrome to desktop mode. |
+ if (win8::IsSingleWindowMetroMode()) { |
+ AppMetroInfoBarDelegateWin::Create( |
+ Profile::FromBrowserContext(context), |
+ AppMetroInfoBarDelegateWin::LAUNCH_PACKAGED_APP, |
+ extension->id()); |
+ return true; |
tapted
2013/10/01 03:24:49
Should this be false?
benwells
2013/10/01 09:26:36
Err, yes. Thanks for catching that!
Done.
|
+ } |
+#endif |
+ return false; |
tapted
2013/10/01 03:24:49
And this one true?
benwells
2013/10/01 09:26:36
Done.
|
+} |