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

Unified Diff: chrome/browser/extensions/platform_app_launcher.cc

Issue 12450014: Show an InfoBar when trying to start Packaged Apps from Metro mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 7 years, 9 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/app/google_chrome_strings.grd ('k') | chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/platform_app_launcher.cc
diff --git a/chrome/browser/extensions/platform_app_launcher.cc b/chrome/browser/extensions/platform_app_launcher.cc
index 0d376098286f04c772a77002469e11c72bc0e94a..7f521f746316d5123786420eb845e8c3311ff7fb 100644
--- a/chrome/browser/extensions/platform_app_launcher.cc
+++ b/chrome/browser/extensions/platform_app_launcher.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/lazy_background_task_queue.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_messages.h"
#include "content/public/browser/browser_thread.h"
@@ -32,6 +33,10 @@
#include "webkit/fileapi/file_system_types.h"
#include "webkit/fileapi/isolated_context.h"
+#if defined(OS_WIN)
+#include "win8/util/win8_util.h"
+#endif
+
using content::BrowserThread;
using extensions::app_file_handler_util::FileHandlerForId;
using extensions::app_file_handler_util::FileHandlerCanHandleFileWithMimeType;
@@ -315,6 +320,18 @@ void LaunchPlatformApp(Profile* profile,
const Extension* extension,
const CommandLine* command_line,
const base::FilePath& current_directory) {
+#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()) {
+ chrome::AppMetroInfoBarDelegateWin::Create(
+ profile,
+ chrome::AppMetroInfoBarDelegateWin::LAUNCH_PACKAGED_APP,
+ extension->id());
+ return;
+ }
+#endif
+
base::FilePath path;
if (!GetAbsolutePathFromCommandLine(command_line, current_directory, &path)) {
LaunchPlatformAppWithNoData(profile, extension);
« no previous file with comments | « chrome/app/google_chrome_strings.grd ('k') | chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698