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( |