Commit 85473026 authored by Bettina Dea's avatar Bettina Dea Committed by Commit Bot

Add IPH Incognito Window Feature Tracker.

Changes in this patch:
-Created a IncognitoWindowTracker class, which contains methods to
notify the IPH server when events happen and if the help UI should be
triggered.
-Created a IncognitoWindowTrackerFactory class and registered in the
chrome browser main parts.
-Added unit tests for IncognitoWindowTracker event logging and expected
functionality.
-Take out event_on_history_deleted as we don't actually need to record
this.

Bug: 734248
Change-Id: Ib25154c50f952b9349884eb48eb58ef1d757a9bb
Reviewed-on: https://chromium-review.googlesource.com/666333
Commit-Queue: Bettina Dea <bdea@chromium.org>
Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarBernhard Bauer <bauerb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502928}
parent dfa957c2
......@@ -3685,6 +3685,10 @@ split_static_library("browser") {
"feature_engagement/bookmark/bookmark_tracker_factory.h",
"feature_engagement/feature_tracker.cc",
"feature_engagement/feature_tracker.h",
"feature_engagement/incognito_window/incognito_window_tracker.cc",
"feature_engagement/incognito_window/incognito_window_tracker.h",
"feature_engagement/incognito_window/incognito_window_tracker_factory.cc",
"feature_engagement/incognito_window/incognito_window_tracker_factory.h",
"feature_engagement/new_tab/new_tab_tracker.cc",
"feature_engagement/new_tab/new_tab_tracker.h",
"feature_engagement/new_tab/new_tab_tracker_factory.cc",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/feature_engagement/incognito_window/incognito_window_tracker.h"
#include "base/time/time.h"
#include "chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.h"
#include "components/feature_engagement/public/event_constants.h"
#include "components/feature_engagement/public/feature_constants.h"
#include "components/feature_engagement/public/tracker.h"
namespace {
constexpr int kDefaultPromoShowTimeInHours = 2;
} // namespace
namespace feature_engagement {
IncognitoWindowTracker::IncognitoWindowTracker(
Profile* profile,
SessionDurationUpdater* session_duration_updater)
: FeatureTracker(profile,
session_duration_updater,
&kIPHIncognitoWindowFeature,
base::TimeDelta::FromHours(kDefaultPromoShowTimeInHours)) {
}
IncognitoWindowTracker::IncognitoWindowTracker(
SessionDurationUpdater* session_duration_updater)
: IncognitoWindowTracker(nullptr, session_duration_updater) {}
IncognitoWindowTracker::~IncognitoWindowTracker() = default;
void IncognitoWindowTracker::OnIncognitoWindowOpened() {
GetTracker()->NotifyEvent(events::kIncognitoWindowOpened);
}
void IncognitoWindowTracker::OnBrowsingDataCleared() {
if (ShouldShowPromo())
ShowPromo();
}
void IncognitoWindowTracker::OnPromoClosed() {
GetTracker()->Dismissed(kIPHIncognitoWindowFeature);
}
void IncognitoWindowTracker::OnSessionTimeMet() {
GetTracker()->NotifyEvent(events::kIncognitoWindowSessionTimeMet);
}
void IncognitoWindowTracker::ShowPromo() {
// TODO: Call the promo.
// Clears the flag for whether there is any in-product help being displayed.
GetTracker()->Dismissed(kIPHIncognitoWindowFeature);
}
} // namespace feature_engagement
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_FEATURE_ENGAGEMENT_INCOGNITO_WINDOW_INCOGNITO_WINDOW_TRACKER_H_
#define CHROME_BROWSER_FEATURE_ENGAGEMENT_INCOGNITO_WINDOW_INCOGNITO_WINDOW_TRACKER_H_
#include "chrome/browser/feature_engagement/feature_tracker.h"
#include "chrome/browser/feature_engagement/session_duration_updater.h"
#include "chrome/browser/feature_engagement/session_duration_updater_factory.h"
namespace feature_engagement {
// The IncognitoWindowTracker provides a backend for displaying in-product help
// for the incognito window. IncognitoWindowTracker is the interface through
// which the event constants for the IncognitoWindow feature can be be altered.
// Once all of the event constants are met, IncognitoWindowTracker calls for the
// IncognitoWindowPromo to be shown, along with recording when the
// IncognitoWindowPromo is dismissed. The requirements to show the
// IncognitoWindowPromo are as follows:
//
// - At least two hours of observed session time have elapsed.
// - The user has never opened incognito window through any means.
// - The user has cleared browsing data.
class IncognitoWindowTracker : public FeatureTracker {
public:
IncognitoWindowTracker(Profile* profile,
SessionDurationUpdater* session_duration_updater);
// Alerts the incognito window tracker that an incognito window was opened.
void OnIncognitoWindowOpened();
// Alerts the incognito window tracker that browsing history was deleted.
void OnBrowsingDataCleared();
// Clears the flag for whether there is any in-product help being displayed.
void OnPromoClosed();
protected:
// Alternate constructor to support unit testing.
explicit IncognitoWindowTracker(
SessionDurationUpdater* session_duration_updater);
~IncognitoWindowTracker() override;
private:
FRIEND_TEST_ALL_PREFIXES(IncognitoWindowTrackerEventTest,
TestOnSessionTimeMet);
FRIEND_TEST_ALL_PREFIXES(IncognitoWindowTrackerTest, TestShouldNotShowPromo);
FRIEND_TEST_ALL_PREFIXES(IncognitoWindowTrackerTest, TestShouldShowPromo);
// FeatureTracker:
void OnSessionTimeMet() override;
// Shows the Incognito Window in-product help promo bubble.
void ShowPromo();
DISALLOW_COPY_AND_ASSIGN(IncognitoWindowTracker);
};
} // namespace feature_engagement
#endif // CHROME_BROWSER_FEATURE_ENGAGEMENT_INCOGNITO_WINDOW_INCOGNITO_WINDOW_TRACKER_H_
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/feature_engagement/incognito_window/incognito_window_tracker_factory.h"
#include "base/memory/singleton.h"
#include "chrome/browser/feature_engagement/incognito_window/incognito_window_tracker.h"
#include "chrome/browser/feature_engagement/session_duration_updater.h"
#include "chrome/browser/feature_engagement/session_duration_updater_factory.h"
#include "chrome/browser/feature_engagement/tracker_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "content/public/browser/browser_context.h"
namespace feature_engagement {
// static
IncognitoWindowTrackerFactory* IncognitoWindowTrackerFactory::GetInstance() {
return base::Singleton<IncognitoWindowTrackerFactory>::get();
}
IncognitoWindowTracker* IncognitoWindowTrackerFactory::GetForProfile(
Profile* profile) {
return static_cast<IncognitoWindowTracker*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
IncognitoWindowTrackerFactory::IncognitoWindowTrackerFactory()
: BrowserContextKeyedServiceFactory(
"IncognitoWindowTracker",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(SessionDurationUpdaterFactory::GetInstance());
DependsOn(TrackerFactory::GetInstance());
}
IncognitoWindowTrackerFactory::~IncognitoWindowTrackerFactory() = default;
KeyedService* IncognitoWindowTrackerFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
return new IncognitoWindowTracker(
Profile::FromBrowserContext(context),
feature_engagement::SessionDurationUpdaterFactory::GetInstance()
->GetForProfile(Profile::FromBrowserContext(context)));
}
content::BrowserContext* IncognitoWindowTrackerFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
} // namespace feature_engagement
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_FEATURE_ENGAGEMENT_INCOGNITO_WINDOW_INCOGNITO_WINDOW_TRACKER_FACTORY_H_
#define CHROME_BROWSER_FEATURE_ENGAGEMENT_INCOGNITO_WINDOW_INCOGNITO_WINDOW_TRACKER_FACTORY_H_
#include "base/macros.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
class Profile;
namespace base {
template <typename T>
struct DefaultSingletonTraits;
} // namespace base
namespace content {
class BrowserContext;
} // namespace content
namespace feature_engagement {
class IncognitoWindowTracker;
// IncognitoWindowTrackerFactory is the main client class for interaction with
// the IncognitoWindowTracker component.
class IncognitoWindowTrackerFactory : public BrowserContextKeyedServiceFactory {
public:
// Returns singleton instance of IncognitoWindowTrackerFactory.
static IncognitoWindowTrackerFactory* GetInstance();
// Returns the FeatureEngagementTracker associated with the profile.
IncognitoWindowTracker* GetForProfile(Profile* profile);
private:
friend struct base::DefaultSingletonTraits<IncognitoWindowTrackerFactory>;
IncognitoWindowTrackerFactory();
~IncognitoWindowTrackerFactory() override;
// BrowserContextKeyedServiceFactory overrides:
KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
DISALLOW_COPY_AND_ASSIGN(IncognitoWindowTrackerFactory);
};
} // namespace feature_engagement
#endif // CHROME_BROWSER_FEATURE_ENGAGEMENT_INCOGNITO_WINDOW_INCOGNITO_WINDOW_TRACKER_FACTORY_H_
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/feature_engagement/incognito_window/incognito_window_tracker.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/field_trial_param_associator.h"
#include "base/metrics/field_trial_params.h"
#include "base/run_loop.h"
#include "base/sequenced_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/feature_engagement/feature_tracker.h"
#include "chrome/browser/feature_engagement/session_duration_updater.h"
#include "chrome/browser/feature_engagement/session_duration_updater_factory.h"
#include "chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "components/feature_engagement/public/event_constants.h"
#include "components/feature_engagement/public/feature_constants.h"
#include "components/feature_engagement/public/tracker.h"
#include "components/feature_engagement/test/test_tracker.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "components/variations/variations_params_manager.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace feature_engagement {
namespace {
const char kIncognitoWindowTrialName[] = "IncognitoWindowTrial";
const char kGroupName[] = "Enabled";
const char kTestProfileName[] = "test-profile";
class MockTracker : public Tracker {
public:
MockTracker() = default;
MOCK_METHOD1(NotifyEvent, void(const std::string& event));
MOCK_METHOD1(ShouldTriggerHelpUI, bool(const base::Feature& feature));
MOCK_METHOD1(GetTriggerState,
Tracker::TriggerState(const base::Feature& feature));
MOCK_METHOD1(Dismissed, void(const base::Feature& feature));
MOCK_METHOD0(IsInitialized, bool());
MOCK_METHOD1(AddOnInitializedCallback, void(OnInitializedCallback callback));
};
class FakeIncognitoWindowTracker : public IncognitoWindowTracker {
public:
FakeIncognitoWindowTracker(Tracker* feature_tracker, Profile* profile)
: IncognitoWindowTracker(
feature_engagement::SessionDurationUpdaterFactory::GetInstance()
->GetForProfile(profile)),
feature_tracker_(feature_tracker),
pref_service_(
base::MakeUnique<sync_preferences::TestingPrefServiceSyncable>()) {
SessionDurationUpdater::RegisterProfilePrefs(pref_service_->registry());
}
PrefService* GetPrefs() { return pref_service_.get(); }
// feature_engagement::NewTabTracker:
Tracker* GetTracker() const override { return feature_tracker_; }
private:
Tracker* const feature_tracker_;
const std::unique_ptr<sync_preferences::TestingPrefServiceSyncable>
pref_service_;
};
class IncognitoWindowTrackerEventTest : public testing::Test {
public:
IncognitoWindowTrackerEventTest() = default;
~IncognitoWindowTrackerEventTest() override = default;
void SetUp() override {
// Start the DesktopSessionDurationTracker to track active session time.
metrics::DesktopSessionDurationTracker::Initialize();
testing_profile_manager_ = base::MakeUnique<TestingProfileManager>(
TestingBrowserProcess::GetGlobal());
ASSERT_TRUE(testing_profile_manager_->SetUp());
mock_tracker_ = base::MakeUnique<testing::StrictMock<MockTracker>>();
incognito_window_tracker_ = base::MakeUnique<FakeIncognitoWindowTracker>(
mock_tracker_.get(),
testing_profile_manager_->CreateTestingProfile(kTestProfileName));
}
void TearDown() override {
incognito_window_tracker_->RemoveSessionDurationObserver();
metrics::DesktopSessionDurationTracker::CleanupForTesting();
// Need to invoke the reset method as TearDown is on the UI thread.
testing_profile_manager_.reset();
}
protected:
std::unique_ptr<TestingProfileManager> testing_profile_manager_;
std::unique_ptr<MockTracker> mock_tracker_;
std::unique_ptr<FakeIncognitoWindowTracker> incognito_window_tracker_;
private:
content::TestBrowserThreadBundle thread_bundle_;
DISALLOW_COPY_AND_ASSIGN(IncognitoWindowTrackerEventTest);
};
} // namespace
// Tests to verify FeatureEngagementTracker API boundary expectations:
// If OnIncognitoWindowOpened() is called, the FeatureEngagementTracker
// receives the kIncognitoWindowOpened.
TEST_F(IncognitoWindowTrackerEventTest, TestOnIncognitoWindowOpened) {
EXPECT_CALL(*mock_tracker_, NotifyEvent(events::kIncognitoWindowOpened));
incognito_window_tracker_->OnIncognitoWindowOpened();
}
// If OnSessionTimeMet() is called, the FeatureEngagementTracker
// receives the kSessionTime event.
TEST_F(IncognitoWindowTrackerEventTest, TestOnSessionTimeMet) {
EXPECT_CALL(*mock_tracker_,
NotifyEvent(events::kIncognitoWindowSessionTimeMet));
incognito_window_tracker_->OnSessionTimeMet();
}
namespace {
class IncognitoWindowTrackerTest : public testing::Test {
public:
IncognitoWindowTrackerTest() = default;
~IncognitoWindowTrackerTest() override = default;
void SetUp() override {
// Set up the kIncognitoWindowTrialName field trial.
base::FieldTrial* incognito_window_trial =
base::FieldTrialList::CreateFieldTrial(kIncognitoWindowTrialName,
kGroupName);
trials_[kIPHIncognitoWindowFeature.name] = incognito_window_trial;
std::unique_ptr<base::FeatureList> feature_list =
base::MakeUnique<base::FeatureList>();
feature_list->RegisterFieldTrialOverride(
kIPHIncognitoWindowFeature.name,
base::FeatureList::OVERRIDE_ENABLE_FEATURE, incognito_window_trial);
scoped_feature_list_.InitWithFeatureList(std::move(feature_list));
ASSERT_EQ(incognito_window_trial,
base::FeatureList::GetFieldTrial(kIPHIncognitoWindowFeature));
std::map<std::string, std::string> incognito_window_params;
incognito_window_params["event_incognito_window_opened"] =
"name:incognito_window_opened;comparator:==0;window:3650;storage:3650";
incognito_window_params["event_incognito_window_session_time_met"] =
"name:incognito_window_session_time_met;comparator:>=1;window:3650;"
"storage:3650";
incognito_window_params["event_trigger"] =
"name:incognito_window_trigger;comparator:==0;window:3650;storage:3650";
incognito_window_params["event_used"] =
"name:incognito_window_clicked;comparator:any;window:3650;storage:3650";
incognito_window_params["session_rate"] = "<=3";
incognito_window_params["availability"] = "any";
SetFeatureParams(kIPHIncognitoWindowFeature, incognito_window_params);
// Start the DesktopSessionDurationTracker to track active session time.
metrics::DesktopSessionDurationTracker::Initialize();
testing_profile_manager_ = base::MakeUnique<TestingProfileManager>(
TestingBrowserProcess::GetGlobal());
ASSERT_TRUE(testing_profile_manager_->SetUp());
feature_engagement_tracker_ = CreateTestTracker();
incognito_window_tracker_ = base::MakeUnique<FakeIncognitoWindowTracker>(
feature_engagement_tracker_.get(),
testing_profile_manager_->CreateTestingProfile(kTestProfileName));
// The feature engagement tracker does async initialization.
base::RunLoop().RunUntilIdle();
ASSERT_TRUE(feature_engagement_tracker_->IsInitialized());
}
void TearDown() override {
incognito_window_tracker_->RemoveSessionDurationObserver();
testing_profile_manager_->DeleteTestingProfile(kTestProfileName);
// Need to invoke the reset method as TearDown is on the UI thread.
testing_profile_manager_.reset();
metrics::DesktopSessionDurationTracker::CleanupForTesting();
// This is required to ensure each test can define its own params.
base::FieldTrialParamAssociator::GetInstance()->ClearAllParamsForTesting();
}
void SetFeatureParams(const base::Feature& feature,
std::map<std::string, std::string> params) {
ASSERT_TRUE(
base::FieldTrialParamAssociator::GetInstance()
->AssociateFieldTrialParams(trials_[feature.name]->trial_name(),
kGroupName, params));
std::map<std::string, std::string> actualParams;
EXPECT_TRUE(base::GetFieldTrialParamsByFeature(feature, &actualParams));
EXPECT_EQ(params, actualParams);
}
protected:
std::unique_ptr<FakeIncognitoWindowTracker> incognito_window_tracker_;
std::unique_ptr<Tracker> feature_engagement_tracker_;
variations::testing::VariationParamsManager params_manager_;
private:
std::unique_ptr<TestingProfileManager> testing_profile_manager_;
base::test::ScopedFeatureList scoped_feature_list_;
content::TestBrowserThreadBundle thread_bundle_;
std::map<std::string, base::FieldTrial*> trials_;
DISALLOW_COPY_AND_ASSIGN(IncognitoWindowTrackerTest);
};
} // namespace
// Tests to verify IncognitoWindowFeatureEngagementTracker functional
// expectations:
// Test that a promo is not shown if the user has not opened Incognito Window.
// If OnIncognitoWindowOpened() is called, the ShouldShowPromo() should return
// false.
TEST_F(IncognitoWindowTrackerTest, TestShouldShowPromo) {
EXPECT_FALSE(incognito_window_tracker_->ShouldShowPromo());
incognito_window_tracker_->OnSessionTimeMet();
EXPECT_TRUE(incognito_window_tracker_->ShouldShowPromo());
incognito_window_tracker_->OnIncognitoWindowOpened();
EXPECT_FALSE(incognito_window_tracker_->ShouldShowPromo());
}
} // namespace feature_engagement
......@@ -49,7 +49,6 @@ class NewTabTracker : public FeatureTracker {
FRIEND_TEST_ALL_PREFIXES(NewTabTrackerTest, TestShouldShowPromo);
FRIEND_TEST_ALL_PREFIXES(NewTabTrackerBrowserTest, TestShowPromo);
base::TimeTicks last_promo_seen_;
// FeatureTracker:
void OnSessionTimeMet() override;
......
......@@ -75,6 +75,7 @@
#include "chrome/browser/undo/bookmark_undo_service_factory.h"
#include "chrome/browser/web_data_service_factory.h"
#include "chrome/common/features.h"
#include "components/feature_engagement/features.h"
#include "components/spellcheck/spellcheck_build_features.h"
#include "extensions/features/features.h"
#include "ppapi/features/features.h"
......@@ -140,8 +141,9 @@
#include "chrome/browser/ui/desktop_ios_promotion/sms_service_factory.h"
#endif
#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
#include "chrome/browser/feature_engagement/bookmark/bookmark_tracker_factory.h"
#include "chrome/browser/feature_engagement/incognito_window/incognito_window_tracker_factory.h"
#include "chrome/browser/feature_engagement/new_tab/new_tab_tracker_factory.h"
#endif
......@@ -285,8 +287,9 @@ EnsureBrowserContextKeyedServiceFactoriesBuilt() {
MediaGalleriesPreferencesFactory::GetInstance();
NTPResourceCacheFactory::GetInstance();
#endif
#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
feature_engagement::BookmarkTrackerFactory::GetInstance();
feature_engagement::IncognitoWindowTrackerFactory::GetInstance();
feature_engagement::NewTabTrackerFactory::GetInstance();
#endif
ContentSuggestionsServiceFactory::GetInstance();
......
......@@ -58,6 +58,7 @@
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/favicon/content/content_favicon_driver.h"
#include "components/feature_engagement/features.h"
#include "components/google/core/browser/google_util.h"
#include "components/prefs/pref_service.h"
#include "components/sessions/core/live_tab_context.h"
......@@ -112,6 +113,11 @@
#include "components/rlz/rlz_tracker.h" // nogncheck
#endif
#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
#include "chrome/browser/feature_engagement/incognito_window/incognito_window_tracker.h"
#include "chrome/browser/feature_engagement/incognito_window/incognito_window_tracker_factory.h"
#endif
namespace {
const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3";
......@@ -552,6 +558,11 @@ void NewWindow(Browser* browser) {
}
void NewIncognitoWindow(Browser* browser) {
#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
feature_engagement::IncognitoWindowTrackerFactory::GetInstance()
->GetForProfile(browser->profile())
->OnIncognitoWindowOpened();
#endif
NewEmptyWindow(browser->profile()->GetOffTheRecordProfile());
}
......
......@@ -3902,6 +3902,7 @@ test("unit_tests") {
sources += [
"../browser/feature_engagement/bookmark/bookmark_tracker_unittest.cc",
"../browser/feature_engagement/feature_tracker_unittest.cc",
"../browser/feature_engagement/incognito_window/incognito_window_tracker_unittest.cc",
"../browser/feature_engagement/new_tab/new_tab_tracker_unittest.cc",
"../browser/feature_engagement/session_duration_updater_unittest.cc",
]
......
......@@ -18,8 +18,10 @@ const char kBookmarkSessionTimeMet[] = "bookmark_session_time_met";
const char kOmniboxInteraction[] = "omnibox_used";
const char kNewTabSessionTimeMet[] = "new_tab_session_time_met";
const char kHistoryDeleted[] = "history_deleted";
const char kIncognitoWindowOpened[] = "incognito_window_opened";
const char kIncognitoWindowSessionTimeMet[] =
"incognito_window_session_time_met";
#endif // BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_IOS)
......
......@@ -34,10 +34,12 @@ extern const char kNewTabSessionTimeMet[];
// All the events declared below are the string names of deferred onboarding
// events for the Incognito Window.
// The user has deleted browsing history.
extern const char kHistoryDeleted[];
// The user has opened an incognito window.
extern const char kIncognitoWindowOpened[];
// The user has satisfied the session time requirement to show the
// IncognitoWindowPromo by accumulating 2 hours of active session time (one-off
// event).
extern const char kIncognitoWindowSessionTimeMet[];
#endif // BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_IOS)
......
......@@ -1348,9 +1348,8 @@
"name": "Enabled",
"params": {
"availability": "any",
"event_history_deleted": "name:history_deleted;comparator:>=1;window:3650;storage:3650",
"event_incognito_window_opened": "name:incognito_window_opened;comparator:==0;window:3650;storage:3650",
"event_session_time": "name:session_time;comparator:>=1;window:3650;storage:3650",
"event_incognito_window_session_time_met": "name:incognito_window_session_time_met;comparator:>=1;window:3650;storage:3650",
"event_trigger": "name:incognito_window_trigger;comparator:==0;window:3650;storage:3650",
"event_used": "name:incognito_window_clicked;comparator:any;window:3650;storage:3650",
"session_rate": "<=3"
......
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