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

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

Issue 10911196: Support for ntp promo bubble. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: allow BR in parseHtmlSubset Created 8 years, 3 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
Index: chrome/browser/ui/webui/ntp/new_tab_page_handler.cc
===================================================================
--- chrome/browser/ui/webui/ntp/new_tab_page_handler.cc (revision 155564)
+++ chrome/browser/ui/webui/ntp/new_tab_page_handler.cc (working copy)
@@ -51,18 +51,24 @@
shown_page_type, kHistogramEnumerationMax);
}
- web_ui()->RegisterMessageCallback("closeNotificationPromo",
- base::Bind(&NewTabPageHandler::HandleCloseNotificationPromo,
+ web_ui()->RegisterMessageCallback("notificationPromoClosed",
+ base::Bind(&NewTabPageHandler::HandleNotificationPromoClosed,
base::Unretained(this)));
web_ui()->RegisterMessageCallback("notificationPromoViewed",
base::Bind(&NewTabPageHandler::HandleNotificationPromoViewed,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback("bubblePromoClosed",
+ base::Bind(&NewTabPageHandler::HandleBubblePromoClosed,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback("bubblePromoViewed",
+ base::Bind(&NewTabPageHandler::HandleBubblePromoViewed,
+ base::Unretained(this)));
web_ui()->RegisterMessageCallback("pageSelected",
base::Bind(&NewTabPageHandler::HandlePageSelected,
base::Unretained(this)));
}
-void NewTabPageHandler::HandleCloseNotificationPromo(const ListValue* args) {
+void NewTabPageHandler::HandleNotificationPromoClosed(const ListValue* args) {
NotificationPromo::HandleClosed(Profile::FromWebUI(web_ui()),
NotificationPromo::NTP_NOTIFICATION_PROMO);
Notify(chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED);
@@ -70,11 +76,24 @@
void NewTabPageHandler::HandleNotificationPromoViewed(const ListValue* args) {
if (NotificationPromo::HandleViewed(Profile::FromWebUI(web_ui()),
- NotificationPromo::NTP_NOTIFICATION_PROMO)) {
+ NotificationPromo::NTP_NOTIFICATION_PROMO)) {
Notify(chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED);
}
}
+void NewTabPageHandler::HandleBubblePromoClosed(const ListValue* args) {
+ NotificationPromo::HandleClosed(Profile::FromWebUI(web_ui()),
+ NotificationPromo::NTP_BUBBLE_PROMO);
+ Notify(chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED);
+}
+
+void NewTabPageHandler::HandleBubblePromoViewed(const ListValue* args) {
+ if (NotificationPromo::HandleViewed(Profile::FromWebUI(web_ui()),
+ NotificationPromo::NTP_BUBBLE_PROMO)) {
+ Notify(chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED);
+ }
+}
+
void NewTabPageHandler::HandlePageSelected(const ListValue* args) {
page_switch_count_++;
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_page_handler.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698