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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 8382010: Some fixups for app notifications: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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/ui/webui/ntp/app_launcher_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
===================================================================
--- chrome/browser/ui/webui/ntp/app_launcher_handler.cc (revision 106989)
+++ chrome/browser/ui/webui/ntp/app_launcher_handler.cc (working copy)
@@ -277,6 +277,9 @@
web_ui_->RegisterMessageCallback("recordAppLaunchByURL",
base::Bind(&AppLauncherHandler::HandleRecordAppLaunchByURL,
base::Unretained(this)));
+ web_ui_->RegisterMessageCallback("closeNotification",
+ base::Bind(&AppLauncherHandler::HandleNotificationClose,
+ base::Unretained(this)));
}
void AppLauncherHandler::Observe(int type,
@@ -837,6 +840,20 @@
RecordAppLaunchByURL(Profile::FromWebUI(web_ui_), url, bucket);
}
+void AppLauncherHandler::HandleNotificationClose(const ListValue* args) {
+ std::string extension_id;
+ CHECK(args->GetString(0, &extension_id));
+
+ const Extension* extension = extension_service_->GetExtensionById(
+ extension_id, true);
+ if (!extension)
+ return;
+
+ AppNotificationManager* notification_manager =
+ extension_service_->app_notification_manager();
+ notification_manager->ClearAll(extension_id);
+}
+
void AppLauncherHandler::OnFaviconForApp(FaviconService::Handle handle,
history::FaviconData data) {
scoped_ptr<AppInstallInfo> install_info(
« no previous file with comments | « chrome/browser/ui/webui/ntp/app_launcher_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698