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

Unified Diff: chrome/browser/apps/chrome_apps_client.cc

Issue 25034003: Moved apps metro code from apps to chrome/browser/apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and fix unit test Created 7 years, 2 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 | « chrome/browser/apps/chrome_apps_client.h ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « chrome/browser/apps/chrome_apps_client.h ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698