Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / apps / app_launch_for_metro_restart_win.cc
index f4e8a1d..05606f5 100644 (file)
@@ -5,7 +5,6 @@
 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h"
 
 #include "apps/launcher.h"
-#include "apps/pref_names.h"
 #include "base/bind.h"
 #include "base/files/file_path.h"
 #include "base/message_loop/message_loop.h"
 #include "base/prefs/pref_service.h"
 #include "base/time/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/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
 #include "chrome/common/pref_names.h"
+#include "extensions/browser/api/app_runtime/app_runtime_api.h"
 #include "extensions/browser/extension_system.h"
-#include "win8/util/win8_util.h"
+#include "extensions/common/constants.h"
 
+using extensions::AppRuntimeEventRouter;
 using extensions::Extension;
 using extensions::ExtensionSystem;
 
@@ -40,7 +40,8 @@ void LaunchAppWithId(Profile* profile,
   if (!extension)
     return;
 
-  extensions::AppEventRouter::DispatchOnLaunchedEvent(profile, extension);
+  AppRuntimeEventRouter::DispatchOnLaunchedEvent(
+      profile, extension, extensions::SOURCE_RESTART);
 }
 
 }  // namespace
@@ -70,13 +71,6 @@ void HandleAppLaunchForMetroRestart(Profile* profile) {
 
   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;
   base::MessageLoop::current()->PostDelayedTask(
       FROM_HERE,