summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-25 00:23:34 +0000
committertapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-25 00:23:34 +0000
commitc1dbcb178ba806f1c7b7e26e4e14deb85cb9b720 (patch)
tree0b1ceb20c77cfd9b02a364e3cbc02ed41f017504
parent0700471c72bca247109af0165d09173ce9c107c8 (diff)
downloadchromium_src-c1dbcb178ba806f1c7b7e26e4e14deb85cb9b720.zip
chromium_src-c1dbcb178ba806f1c7b7e26e4e14deb85cb9b720.tar.gz
chromium_src-c1dbcb178ba806f1c7b7e26e4e14deb85cb9b720.tar.bz2
Show an InfoBar when trying to start Packaged Apps from Metro mode.
Platform Apps do not function properly while in Metro mode. This change intercepts platform app launch requests done while the browser is in metro mode, redirecting them to an infobar. If "yes" is chosen, a local pref is stored with the extension id and Profile that tried to launch it, and a relaunch of Chrome in Desktop mode is triggered. Upon restart, apps::AppLaunchOnRestartService is responsible for launching the selected app, and clearing the pref. BUG=153426 TEST=With Chrome configured for Windows 8 mode, try to start a packaged app. This can be done from NTP (if launcher not enabled), or from a taskbar shortcut, a desktop shortcut, or a pinned start page tile. InfoBar should display offering to switch to Desktop mode. If switching, selected packaged app should launch after a brief delay. Review URL: https://chromiumcodereview.appspot.com/12450014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190306 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--apps/DEPS1
-rw-r--r--apps/app_launch_for_metro_restart_win.cc95
-rw-r--r--apps/app_launch_for_metro_restart_win.h26
-rw-r--r--apps/apps.gypi12
-rw-r--r--apps/pref_names.cc9
-rw-r--r--apps/pref_names.h2
-rw-r--r--apps/prefs.cc5
-rw-r--r--chrome/app/chromium_strings.grd8
-rw-r--r--chrome/app/google_chrome_strings.grd8
-rw-r--r--chrome/browser/extensions/platform_app_launcher.cc17
-rw-r--r--chrome/browser/ui/extensions/app_metro_infobar_delegate_win.cc46
-rw-r--r--chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h25
-rw-r--r--chrome/browser/ui/startup/startup_browser_creator_impl.cc10
-rw-r--r--chrome/browser/ui/views/app_list/app_list_controller_win.cc5
14 files changed, 237 insertions, 32 deletions
diff --git a/apps/DEPS b/apps/DEPS
index df03f2b..fb10d13 100644
--- a/apps/DEPS
+++ b/apps/DEPS
@@ -2,6 +2,7 @@ include_rules = [
"+base",
"+content",
"+ui",
+ "+win8",
# Temporary allowed includes.
# TODO(benwells): remove these (http://crbug.com/159366)
"+chrome/browser/browser_process.h",
diff --git a/apps/app_launch_for_metro_restart_win.cc b/apps/app_launch_for_metro_restart_win.cc
new file mode 100644
index 0000000..1fa0cc9
--- /dev/null
+++ b/apps/app_launch_for_metro_restart_win.cc
@@ -0,0 +1,95 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "apps/app_launch_for_metro_restart_win.h"
+
+#include "apps/pref_names.h"
+#include "base/bind.h"
+#include "base/files/file_path.h"
+#include "base/message_loop.h"
+#include "base/prefs/pref_service.h"
+#include "base/time.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h"
+#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_system.h"
+#include "chrome/browser/extensions/platform_app_launcher.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_manager.h"
+#include "win8/util/win8_util.h"
+
+using extensions::Extension;
+using extensions::ExtensionSystem;
+
+namespace apps {
+
+namespace {
+
+void LaunchAppWithId(Profile* profile,
+ const std::string& extension_id) {
+ ExtensionService* extension_service =
+ ExtensionSystem::Get(profile)->extension_service();
+ if (!extension_service)
+ return;
+
+ const Extension* extension =
+ extension_service->GetExtensionById(extension_id, false);
+ if (!extension)
+ return;
+
+ extensions::AppEventRouter::DispatchOnLaunchedEvent(profile, extension);
+}
+
+} // namespace
+
+void HandleAppLaunchForMetroRestart(Profile* profile) {
+ PrefService* prefs = g_browser_process->local_state();
+ if (!prefs->HasPrefPath(prefs::kAppLaunchForMetroRestartProfile))
+ return;
+
+ // This will be called for each profile that had a browser window open before
+ // relaunch. After checking that the preference is set, check that the
+ // profile that is starting up matches the profile that initially wanted to
+ // launch the app.
+ base::FilePath profile_dir = base::FilePath::FromUTF8Unsafe(
+ prefs->GetString(prefs::kAppLaunchForMetroRestartProfile));
+ if (profile_dir.empty() || profile->GetPath().BaseName() != profile_dir)
+ return;
+
+ prefs->ClearPref(prefs::kAppLaunchForMetroRestartProfile);
+
+ if (!prefs->HasPrefPath(prefs::kAppLaunchForMetroRestart))
+ return;
+
+ std::string extension_id = prefs->GetString(prefs::kAppLaunchForMetroRestart);
+ if (extension_id.empty())
+ return;
+
+ prefs->ClearPref(prefs::kAppLaunchForMetroRestart);
+
+ if (win8::IsSingleWindowMetroMode()) {
+ // In this case we have relaunched with the correct profile, but we are not
+ // in Desktop mode, so can not launch apps. Leave the preferences cleared so
+ // there are no surprises later.
+ return;
+ }
+
+ const int kRestartAppLaunchDelayMs = 1000;
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&LaunchAppWithId,
+ profile,
+ extension_id),
+ base::TimeDelta::FromMilliseconds(kRestartAppLaunchDelayMs));
+}
+
+void SetAppLaunchForMetroRestart(Profile* profile,
+ const std::string& extension_id) {
+ PrefService* prefs = g_browser_process->local_state();
+ prefs->SetString(prefs::kAppLaunchForMetroRestartProfile,
+ profile->GetPath().BaseName().MaybeAsASCII());
+ prefs->SetString(prefs::kAppLaunchForMetroRestart, extension_id);
+}
+
+} // namespace apps
diff --git a/apps/app_launch_for_metro_restart_win.h b/apps/app_launch_for_metro_restart_win.h
new file mode 100644
index 0000000..dfbd13e
--- /dev/null
+++ b/apps/app_launch_for_metro_restart_win.h
@@ -0,0 +1,26 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef APPS_APP_LAUNCH_FOR_METRO_RESTART_WIN_H
+#define APPS_APP_LAUNCH_FOR_METRO_RESTART_WIN_H
+
+#include <string>
+
+#include "base/basictypes.h"
+
+class Profile;
+
+namespace apps {
+
+// Handles launching apps on browser startup due to an attempt to launch an app
+// in Windows 8 Metro mode.
+void HandleAppLaunchForMetroRestart(Profile* profile);
+
+// Set a local pref to launch an app before relaunching chrome in desktop mode.
+void SetAppLaunchForMetroRestart(Profile* profile,
+ const std::string& extension_id);
+
+} // namespace apps
+
+#endif // APPS_APP_LAUNCH_FOR_METRO_RESTART_WIN_H
diff --git a/apps/apps.gypi b/apps/apps.gypi
index aa2330b..8760e17 100644
--- a/apps/apps.gypi
+++ b/apps/apps.gypi
@@ -1,4 +1,4 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -22,16 +22,18 @@
'<(INTERMEDIATE_DIR)',
],
'sources': [
- 'app_shim/app_shim_host_mac.cc',
- 'app_shim/app_shim_host_mac.h',
- 'app_shim/app_shim_host_manager_mac.h',
- 'app_shim/app_shim_host_manager_mac.mm',
+ 'app_launch_for_metro_restart_win.cc',
+ 'app_launch_for_metro_restart_win.h',
'app_launcher.cc',
'app_launcher.h',
'app_restore_service.cc',
'app_restore_service.h',
'app_restore_service_factory.cc',
'app_restore_service_factory.h',
+ 'app_shim/app_shim_host_mac.cc',
+ 'app_shim/app_shim_host_mac.h',
+ 'app_shim/app_shim_host_manager_mac.h',
+ 'app_shim/app_shim_host_manager_mac.mm',
'pref_names.cc',
'pref_names.h',
'prefs.cc',
diff --git a/apps/pref_names.cc b/apps/pref_names.cc
index 15a33f9..d4ac6fa 100644
--- a/apps/pref_names.cc
+++ b/apps/pref_names.cc
@@ -12,6 +12,15 @@ namespace prefs {
const char kAppLauncherIsEnabled[] =
"apps.app_launcher.should_show_apps_page";
+// If set, the user requested to launch the app with this extension id while
+// in Metro mode, and then relaunched to Desktop mode to start it.
+const char kAppLaunchForMetroRestart[] = "apps.app_launch_for_metro_restart";
+
+// Set with |kAppLaunchForMetroRestart|, the profile whose loading triggers
+// launch of the specified app when restarting Chrome in desktop mode.
+const char kAppLaunchForMetroRestartProfile[] =
+ "apps.app_launch_for_metro_restart_profile";
+
} // namespace prefs
} // namespace apps
diff --git a/apps/pref_names.h b/apps/pref_names.h
index 90fc5d6..db6ad7c 100644
--- a/apps/pref_names.h
+++ b/apps/pref_names.h
@@ -11,6 +11,8 @@ namespace prefs {
// Alphabetical list of preference names specific to Apps component.
// Keep alphabetized and document each one in the source file.
extern const char kAppLauncherIsEnabled[];
+extern const char kAppLaunchForMetroRestart[];
+extern const char kAppLaunchForMetroRestartProfile[];
} // namespace prefs
} // namespace apps
diff --git a/apps/prefs.cc b/apps/prefs.cc
index b883fbb..edaf119 100644
--- a/apps/prefs.cc
+++ b/apps/prefs.cc
@@ -20,6 +20,11 @@ void RegisterPrefs(PrefRegistrySimple* registry) {
// GetIsAppLauncherEnabled().
registry->RegisterBooleanPref(prefs::kAppLauncherIsEnabled,
MaybeIsAppLauncherEnabled());
+
+#if defined(OS_WIN)
+ registry->RegisterStringPref(prefs::kAppLaunchForMetroRestart, "");
+ registry->RegisterStringPref(prefs::kAppLaunchForMetroRestartProfile, "");
+#endif
}
} // namespace apps
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd
index b26f85d..30d6f59 100644
--- a/chrome/app/chromium_strings.grd
+++ b/chrome/app/chromium_strings.grd
@@ -238,10 +238,14 @@ be available for now. -->
<message name="IDS_PRODUCT_APP_LAUNCHER_NAME" desc="The Chrome App Launcher application name">
Chromium App Launcher
</message>
- <message name="IDS_WIN8_INFOBAR_DESKTOP_RESTART_TO_LAUNCH_APPS"
- desc="Infobar message to restart chrome in desktop mode to launch Chrome Apps. Aplies to Windows 8 only">
+ <message name="IDS_WIN8_INFOBAR_DESKTOP_RESTART_FOR_APP_LIST"
+ desc="Infobar message to restart chrome in desktop mode to display the App Launcher. Aplies to Windows 8 only">
You need to switch Chromium to desktop mode to use the App Launcher.
</message>
+ <message name="IDS_WIN8_INFOBAR_DESKTOP_RESTART_FOR_PACKAGED_APP"
+ desc="Infobar message to restart chrome in desktop mode to launch a Chrome Packaged App. Aplies to Windows 8 only">
+ You need to switch Chromium to desktop mode to use Apps.
+ </message>
<message name="IDS_PRODUCT_BINARIES_NAME" desc="The Chrome Binaries application name">
Chromium Binaries
</message>
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd
index aba81ed..d27d72a0 100644
--- a/chrome/app/google_chrome_strings.grd
+++ b/chrome/app/google_chrome_strings.grd
@@ -161,10 +161,14 @@ Chrome supports. -->
<message name="IDS_PRODUCT_APP_LAUNCHER_NAME" desc="The Chrome App Launcher application name">
Google Chrome App Launcher
</message>
- <message name="IDS_WIN8_INFOBAR_DESKTOP_RESTART_TO_LAUNCH_APPS"
- desc="Infobar message to restart chrome in desktop mode to launch Chrome Apps. Aplies to Windows 8 only">
+ <message name="IDS_WIN8_INFOBAR_DESKTOP_RESTART_FOR_APP_LIST"
+ desc="Infobar message to restart chrome in desktop mode to display the App Launcher. Aplies to Windows 8 only">
You need to switch Chrome to desktop mode to use the App Launcher.
</message>
+ <message name="IDS_WIN8_INFOBAR_DESKTOP_RESTART_FOR_PACKAGED_APP"
+ desc="Infobar message to restart chrome in desktop mode to launch a Chrome Packaged App. Aplies to Windows 8 only">
+ You need to switch Chrome to desktop mode to use Apps.
+ </message>
<message name="IDS_PRODUCT_BINARIES_NAME" desc="The Chrome Binaries application name">
Google Chrome Binaries
</message>
diff --git a/chrome/browser/extensions/platform_app_launcher.cc b/chrome/browser/extensions/platform_app_launcher.cc
index b4064bf..6effb60 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"
@@ -39,6 +40,10 @@
#include "chrome/browser/chromeos/drive/drive_system_service.h"
#endif
+#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;
@@ -363,6 +368,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);
diff --git a/chrome/browser/ui/extensions/app_metro_infobar_delegate_win.cc b/chrome/browser/ui/extensions/app_metro_infobar_delegate_win.cc
index 42ae188..0249421 100644
--- a/chrome/browser/ui/extensions/app_metro_infobar_delegate_win.cc
+++ b/chrome/browser/ui/extensions/app_metro_infobar_delegate_win.cc
@@ -4,10 +4,12 @@
#include "chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h"
+#include "apps/app_launch_for_metro_restart_win.h"
#include "base/bind_helpers.h"
#include "base/message_loop.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
@@ -25,10 +27,14 @@
namespace chrome {
-void AppMetroInfoBarDelegateWin::CreateAndActivateMetro(Profile* profile) {
+// static
+void AppMetroInfoBarDelegateWin::Create(
+ Profile* profile, Mode mode, const std::string& extension_id) {
+ DCHECK(win8::IsSingleWindowMetroMode());
+ DCHECK_EQ(mode == SHOW_APP_LIST, extension_id.empty());
+
// Chrome should never get here via the Ash desktop, so only look for browsers
// on the native desktop.
- CHECK(win8::IsSingleWindowMetroMode());
Browser* browser = FindOrCreateTabbedBrowser(
profile, chrome::HOST_DESKTOP_TYPE_NATIVE);
@@ -42,7 +48,7 @@ void AppMetroInfoBarDelegateWin::CreateAndActivateMetro(Profile* profile) {
InfoBarService* info_bar_service =
InfoBarService::FromWebContents(web_contents);
info_bar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
- new AppMetroInfoBarDelegateWin(info_bar_service)));
+ new AppMetroInfoBarDelegateWin(info_bar_service, mode, extension_id)));
// Use PostTask because we can get here in a COM SendMessage, and
// ActivateApplication can not be sent nested (returns error
@@ -53,8 +59,13 @@ void AppMetroInfoBarDelegateWin::CreateAndActivateMetro(Profile* profile) {
}
AppMetroInfoBarDelegateWin::AppMetroInfoBarDelegateWin(
- InfoBarService* info_bar_service)
- : ConfirmInfoBarDelegate(info_bar_service) {
+ InfoBarService* info_bar_service,
+ Mode mode,
+ const std::string& extension_id)
+ : ConfirmInfoBarDelegate(info_bar_service),
+ mode_(mode),
+ extension_id_(extension_id) {
+ DCHECK_EQ(mode_ == SHOW_APP_LIST, extension_id_.empty());
}
AppMetroInfoBarDelegateWin::~AppMetroInfoBarDelegateWin() {}
@@ -64,8 +75,9 @@ gfx::Image* AppMetroInfoBarDelegateWin::GetIcon() const {
}
string16 AppMetroInfoBarDelegateWin::GetMessageText() const {
- return l10n_util::GetStringUTF16(
- IDS_WIN8_INFOBAR_DESKTOP_RESTART_TO_LAUNCH_APPS);
+ return l10n_util::GetStringUTF16(mode_ == SHOW_APP_LIST ?
+ IDS_WIN8_INFOBAR_DESKTOP_RESTART_FOR_APP_LIST :
+ IDS_WIN8_INFOBAR_DESKTOP_RESTART_FOR_PACKAGED_APP);
}
int AppMetroInfoBarDelegateWin::GetButtons() const {
@@ -74,19 +86,23 @@ int AppMetroInfoBarDelegateWin::GetButtons() const {
string16 AppMetroInfoBarDelegateWin::GetButtonLabel(
InfoBarButton button) const {
- if (button == BUTTON_CANCEL) {
- return l10n_util::GetStringUTF16(
- IDS_WIN8_INFOBAR_DESKTOP_RESTART_TO_LAUNCH_APPS_NO_BUTTON);
- }
-
- return l10n_util::GetStringUTF16(
+ return l10n_util::GetStringUTF16(button == BUTTON_CANCEL ?
+ IDS_WIN8_INFOBAR_DESKTOP_RESTART_TO_LAUNCH_APPS_NO_BUTTON :
IDS_WIN8_INFOBAR_DESKTOP_RESTART_TO_LAUNCH_APPS_YES_BUTTON);
}
bool AppMetroInfoBarDelegateWin::Accept() {
- owner()->GetWebContents()->Close();
PrefService* prefs = g_browser_process->local_state();
- prefs->SetBoolean(prefs::kRestartWithAppList, true);
+ content::WebContents* web_contents = owner()->GetWebContents();
+ if (mode_ == SHOW_APP_LIST) {
+ prefs->SetBoolean(prefs::kRestartWithAppList, true);
+ } else {
+ apps::SetAppLaunchForMetroRestart(
+ Profile::FromBrowserContext(web_contents->GetBrowserContext()),
+ extension_id_);
+ }
+
+ web_contents->Close(); // Note: deletes |this|.
chrome::AttemptRestartWithModeSwitch();
return false;
}
diff --git a/chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h b/chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h
index f82a844..b56278f 100644
--- a/chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h
+++ b/chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h
@@ -23,13 +23,21 @@ namespace chrome {
// in Desktop mode if confirmed.
class AppMetroInfoBarDelegateWin : public ConfirmInfoBarDelegate {
public:
- // Creates an instance of the app metro infobar delegate, adds it to
- // |infobar_service|, and then activates metro mode. This CHECK()s to ensure
- // that it is only called while running in desktop mode.
- static void CreateAndActivateMetro(Profile* profile);
+ enum Mode {
+ SHOW_APP_LIST,
+ LAUNCH_PACKAGED_APP
+ };
+
+ // Creates an instance of the app metro infobar delegate, adds it to a new
+ // browser tab, then activates Metro mode.
+ static void Create(Profile* profile,
+ Mode mode,
+ const std::string& extension_id);
private:
- explicit AppMetroInfoBarDelegateWin(InfoBarService* infobar_service);
+ explicit AppMetroInfoBarDelegateWin(InfoBarService* infobar_service,
+ Mode mode,
+ const std::string& extension_id);
virtual ~AppMetroInfoBarDelegateWin();
// ConfirmInfoBarDelegate overrides:
@@ -42,9 +50,12 @@ class AppMetroInfoBarDelegateWin : public ConfirmInfoBarDelegate {
virtual string16 GetLinkText() const OVERRIDE;
virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
+ Mode mode_;
+ std::string extension_id_;
+
DISALLOW_COPY_AND_ASSIGN(AppMetroInfoBarDelegateWin);
};
-#endif // CHROME_BROWSER_UI_EXTENSIONS_APP_METRO_INFOBAR_DELEGATE_WIN_H_
-
} // namespace chrome
+
+#endif // CHROME_BROWSER_UI_EXTENSIONS_APP_METRO_INFOBAR_DELEGATE_WIN_H_
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index b9c3c10..52c0620 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -101,6 +101,7 @@
#endif
#if defined(OS_WIN)
+#include "apps/app_launch_for_metro_restart_win.h"
#include "base/win/windows_version.h"
#endif
@@ -567,6 +568,15 @@ void StartupBrowserCreatorImpl::ProcessLaunchURLs(
return;
}
+// TODO(tapted): Move this to startup_browser_creator_win.cc after refactor.
+#if defined(OS_WIN)
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
+ // See if there are apps for this profile that should be launched on startup
+ // due to a switch from Metro mode.
+ apps::HandleAppLaunchForMetroRestart(profile_);
+ }
+#endif
+
if (process_startup && ProcessStartupURLs(urls_to_open)) {
// ProcessStartupURLs processed the urls, nothing else to do.
return;
diff --git a/chrome/browser/ui/views/app_list/app_list_controller_win.cc b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
index b932649..76d27f6 100644
--- a/chrome/browser/ui/views/app_list/app_list_controller_win.cc
+++ b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
@@ -501,7 +501,10 @@ void AppListController::ShowAppList(Profile* profile) {
if (win8::IsSingleWindowMetroMode()) {
// This request came from Windows 8 in desktop mode, but chrome is currently
// running in Metro mode.
- chrome::AppMetroInfoBarDelegateWin::CreateAndActivateMetro(profile);
+ chrome::AppMetroInfoBarDelegateWin::Create(
+ profile,
+ chrome::AppMetroInfoBarDelegateWin::SHOW_APP_LIST,
+ std::string());
return;
}