Commit 2499fb4c authored by achuith@chromium.org's avatar achuith@chromium.org

Count user dismissals of notification promo.

Also move NTPPromoShown to notification_promo.cc

BUG=106743
TEST=NONE.

Review URL: http://codereview.chromium.org/8833009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113468 0039d316-1c4b-4281-b951-d872f2087c98
parent b134a460
......@@ -36,7 +36,6 @@
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "grit/browser_resources.h"
......@@ -379,7 +378,6 @@ void NTPResourceCache::CreateNewTabHTML() {
if (PromoResourceService::CanShowNotificationPromo(profile_)) {
localized_strings.SetString("serverpromo",
profile_->GetPrefs()->GetString(prefs::kNTPPromoLine));
UserMetrics::RecordAction(UserMetricsAction("NTPPromoShown"));
}
// Load the new tab page appropriate for this build
......
......@@ -4,6 +4,8 @@
#include "chrome/browser/web_resource/notification_promo.h"
#include <vector>
#include "base/bind.h"
#include "base/rand_util.h"
#include "base/string_number_conversions.h"
......@@ -14,6 +16,7 @@
#include "chrome/browser/profiles/profile_impl.h"
#include "chrome/browser/web_resource/promo_resource_service.h"
#include "chrome/common/pref_names.h"
#include "content/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
#include "net/base/cookie_store.h"
#include "net/url_request/url_request_context.h"
......@@ -332,10 +335,12 @@ bool NotificationPromo::CanShow() const {
}
void NotificationPromo::HandleClosed() {
UserMetrics::RecordAction(UserMetricsAction("NTPPromoClosed"));
prefs_->SetBoolean(prefs::kNTPPromoClosed, true);
}
bool NotificationPromo::HandleViewed() {
UserMetrics::RecordAction(UserMetricsAction("NTPPromoShown"));
if (prefs_->HasPrefPath(prefs::kNTPPromoViewsMax))
max_views_ = prefs_->GetInteger(prefs::kNTPPromoViewsMax);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment