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

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

Issue 14348015: Send onLaunched to apps that don't listen to onRestarted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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/extensions/event_names.cc ('k') | no next file » | 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 66466ff4130a45e8650dac77673ee1e231c8fe20..8a072ae2e9b6952823deef08885e9e9ec82725ff 100644
--- a/chrome/browser/extensions/platform_app_launcher.cc
+++ b/chrome/browser/extensions/platform_app_launcher.cc
@@ -14,6 +14,8 @@
#include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h"
#include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h"
#include "chrome/browser/extensions/api/file_system/file_system_api.h"
+#include "chrome/browser/extensions/event_names.h"
+#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_process_manager.h"
@@ -415,9 +417,17 @@ void RestartPlatformAppWithFileEntries(
Profile* profile,
const Extension* extension,
const std::vector<SavedFileEntry>& file_entries) {
- scoped_refptr<SavedFileEntryLauncher> launcher = new SavedFileEntryLauncher(
- profile, extension, file_entries);
- launcher->Launch();
+ bool listening_to_restart = ExtensionSystem::Get(profile)->event_router()->
+ ExtensionHasEventListener(extension->id(),
+ event_names::kOnRestarted);
+
+ if (listening_to_restart) {
+ scoped_refptr<SavedFileEntryLauncher> launcher = new SavedFileEntryLauncher(
+ profile, extension, file_entries);
+ launcher->Launch();
+ } else {
+ LaunchPlatformAppWithNoData(profile, extension);
+ }
}
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/event_names.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698