#include "chrome/browser/ui/webui/whats_new/whats_new_handler.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/rand_util.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/global_features.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/hats/hats_service.h"
#include "chrome/browser/ui/hats/hats_service_factory.h"
#include "chrome/browser/ui/webui/whats_new/whats_new_fetcher.h"
#include "chrome/browser/ui/webui/whats_new/whats_new_util.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_version.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_service.h"
#include "components/user_education/common/user_education_features.h"
#include "components/user_education/webui/whats_new_registry.h"
#include "components/variations/service/variations_service.h"
#include "url/gurl.h"
WhatsNewHandler::WhatsNewHandler(
mojo::PendingReceiver<whats_new::mojom::PageHandler> receiver,
mojo::PendingRemote<whats_new::mojom::Page> page,
Profile* profile,
content::WebContents* web_contents,
const base::Time& navigation_start_time)
: … { … }
WhatsNewHandler::~WhatsNewHandler() = default;
void WhatsNewHandler::RecordTimeToLoadContent(base::Time time) { … }
void WhatsNewHandler::RecordVersionPageLoaded(bool is_auto_open) { … }
void WhatsNewHandler::RecordEditionPageLoaded(const std::string& page_uid,
bool is_auto_open) { … }
void WhatsNewHandler::RecordModuleImpression(
const std::string& module_name,
whats_new::mojom::ModulePosition position) { … }
void WhatsNewHandler::RecordExploreMoreToggled(bool expanded) { … }
void WhatsNewHandler::RecordScrollDepth(whats_new::mojom::ScrollDepth depth) { … }
void WhatsNewHandler::RecordTimeOnPage(base::TimeDelta time) { … }
void WhatsNewHandler::RecordModuleLinkClicked(
const std::string& module_name,
whats_new::mojom::ModulePosition position) { … }
void WhatsNewHandler::RecordBrowserCommandExecuted() { … }
void WhatsNewHandler::GetServerUrl(bool is_staging,
GetServerUrlCallback callback) { … }
std::string WhatsNewHandler::GetLatestCountry() { … }
bool WhatsNewHandler::IsHaTSActivated() { … }
void WhatsNewHandler::TryShowHatsSurveyWithTimeout() { … }