| 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..d95d139c860b2a6707fa68aa8a6853523a882828 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 false;
|
| + }
|
| +#endif
|
| + return true;
|
| +}
|
|
|