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

Unified Diff: chrome/browser/extensions/api/app/app_api.cc

Issue 10080017: Switch platform apps from a declarative launch container to handling an onLaunched event. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: remove debug logging code Created 8 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/api/app/app_api.h ('k') | chrome/browser/extensions/crx_installer_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/app/app_api.cc
diff --git a/chrome/browser/extensions/api/app/app_api.cc b/chrome/browser/extensions/api/app/app_api.cc
index 719ea93d45408f00a0be573002ba3938a55c5930..d429710f0fb7355c0a083c9e8da9509cbc7178bc 100644
--- a/chrome/browser/extensions/api/app/app_api.cc
+++ b/chrome/browser/extensions/api/app/app_api.cc
@@ -7,12 +7,16 @@
#include "base/values.h"
#include "base/time.h"
#include "chrome/browser/extensions/app_notification_manager.h"
+#include "chrome/browser/extensions/extension_event_router.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "content/public/browser/notification_service.h"
+#include "googleurl/src/gurl.h"
+
+namespace {
const char kBodyTextKey[] = "bodyText";
const char kExtensionIdKey[] = "extensionId";
@@ -24,6 +28,11 @@ const char kInvalidExtensionIdError[] =
"Invalid extension id";
const char kMissingLinkTextError[] =
"You must specify linkText if you use linkUrl";
+const char kOnLaunchedEvent[] = "experimental.app.onLaunched";
+
+} // anonymous namespace
+
+namespace extensions {
bool AppNotifyFunction::RunImpl() {
if (!include_incognito() && profile_->IsOffTheRecord()) {
@@ -103,3 +112,12 @@ bool AppClearAllNotificationsFunction::RunImpl() {
manager->ClearAll(id);
return true;
}
+
+// static.
+void AppEventRouter::DispatchOnLaunchedEvent(
+ Profile* profile, const Extension* extension) {
+ profile->GetExtensionEventRouter()->DispatchEventToExtension(
+ extension->id(), kOnLaunchedEvent, "[]", NULL, GURL());
+}
+
+} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/api/app/app_api.h ('k') | chrome/browser/extensions/crx_installer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698