Commit 7cf084df authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Gave three constants in feature_engagement unique names

In jumbo builds many cc files compile in the same translation
unit and then they all share the same anonymous namespace. If
two or more variables have the same name, they will cause
compilation errors and that happened with the three
kDefaultPromoShowTimeInHour constants.

As a preparatory patch to jumbo in chrome/browser this renames
those by adding a relevant prefix to each of them.

Bug: 746957
Change-Id: If17d8103a6916c14b493e203e445208bb1b1b2d6
Reviewed-on: https://chromium-review.googlesource.com/893273Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533728}
parent c46f9bbd
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
namespace { namespace {
constexpr int kDefaultPromoShowTimeInHours = 5; constexpr int kDefaultBookmarkPromoShowTimeInHours = 5;
constexpr char kBookmarkObservedSessionTimeKey[] = constexpr char kBookmarkObservedSessionTimeKey[] =
"bookmark_in_product_help_observed_session_time_key"; "bookmark_in_product_help_observed_session_time_key";
...@@ -23,11 +23,11 @@ constexpr char kBookmarkObservedSessionTimeKey[] = ...@@ -23,11 +23,11 @@ constexpr char kBookmarkObservedSessionTimeKey[] =
namespace feature_engagement { namespace feature_engagement {
BookmarkTracker::BookmarkTracker(Profile* profile) BookmarkTracker::BookmarkTracker(Profile* profile)
: FeatureTracker(profile, : FeatureTracker(
&kIPHBookmarkFeature, profile,
kBookmarkObservedSessionTimeKey, &kIPHBookmarkFeature,
base::TimeDelta::FromHours(kDefaultPromoShowTimeInHours)) { kBookmarkObservedSessionTimeKey,
} base::TimeDelta::FromHours(kDefaultBookmarkPromoShowTimeInHours)) {}
BookmarkTracker::~BookmarkTracker() = default; BookmarkTracker::~BookmarkTracker() = default;
......
...@@ -26,9 +26,9 @@ class Tracker; ...@@ -26,9 +26,9 @@ class Tracker;
// each session ending, updates all of the FeatureTrackers with the new total // each session ending, updates all of the FeatureTrackers with the new total
// observed session time. Once the observed session time exceeds the time // observed session time. Once the observed session time exceeds the time
// requirement provided by GetSessionTimeRequiredToShow(), the // requirement provided by GetSessionTimeRequiredToShow(), the
// FeatureTracker unregisters itself as an obsever of SessionDurationUpdater. // FeatureTracker unregisters itself as an observer of SessionDurationUpdater.
// SessionDurationUpdater stops updating the observed session time if no // SessionDurationUpdater stops updating the observed session time if no
// features are observing it, and will start tracking the observed sesion time // features are observing it, and will start tracking the observed session time
// again if another feature is added as an observer later. // again if another feature is added as an observer later.
// //
// Desktop In Product Help only shows promos to new users which means that // Desktop In Product Help only shows promos to new users which means that
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
namespace { namespace {
constexpr int kDefaultPromoShowTimeInHours = 2; constexpr int kDefaultIncognitoWindowPromoShowTimeInHours = 2;
constexpr char kIncognitoWindowObservedSessionTimeKey[] = constexpr char kIncognitoWindowObservedSessionTimeKey[] =
"incognito_window_in_product_help_observed_session_time_key"; "incognito_window_in_product_help_observed_session_time_key";
...@@ -41,7 +41,8 @@ IncognitoWindowTracker::IncognitoWindowTracker(Profile* profile) ...@@ -41,7 +41,8 @@ IncognitoWindowTracker::IncognitoWindowTracker(Profile* profile)
: FeatureTracker(profile, : FeatureTracker(profile,
&kIPHIncognitoWindowFeature, &kIPHIncognitoWindowFeature,
kIncognitoWindowObservedSessionTimeKey, kIncognitoWindowObservedSessionTimeKey,
base::TimeDelta::FromHours(kDefaultPromoShowTimeInHours)), base::TimeDelta::FromHours(
kDefaultIncognitoWindowPromoShowTimeInHours)),
incognito_promo_observer_(this) {} incognito_promo_observer_(this) {}
IncognitoWindowTracker::~IncognitoWindowTracker() = default; IncognitoWindowTracker::~IncognitoWindowTracker() = default;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
namespace { namespace {
const int kDefaultPromoShowTimeInHours = 2; const int kDefaultNewTabPromoShowTimeInHours = 2;
constexpr char kNewTabObservedSessionTimeKey[] = constexpr char kNewTabObservedSessionTimeKey[] =
"new_tab_in_product_help_observed_session_time_key"; "new_tab_in_product_help_observed_session_time_key";
...@@ -22,11 +22,11 @@ constexpr char kNewTabObservedSessionTimeKey[] = ...@@ -22,11 +22,11 @@ constexpr char kNewTabObservedSessionTimeKey[] =
namespace feature_engagement { namespace feature_engagement {
NewTabTracker::NewTabTracker(Profile* profile) NewTabTracker::NewTabTracker(Profile* profile)
: FeatureTracker(profile, : FeatureTracker(
&kIPHNewTabFeature, profile,
kNewTabObservedSessionTimeKey, &kIPHNewTabFeature,
base::TimeDelta::FromHours(kDefaultPromoShowTimeInHours)) { kNewTabObservedSessionTimeKey,
} base::TimeDelta::FromHours(kDefaultNewTabPromoShowTimeInHours)) {}
NewTabTracker::~NewTabTracker() = default; NewTabTracker::~NewTabTracker() = default;
......
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