chromium/chrome/browser/history_clusters/history_clusters_tab_helper.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/history_clusters/history_clusters_tab_helper.h"

#include <functional>
#include <memory>
#include <utility>

#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/history_utils.h"
#include "chrome/browser/history_clusters/history_clusters_metrics_logger.h"
#include "chrome/browser/history_clusters/history_clusters_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/webui_url_constants.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/url_row.h"
#include "components/history_clusters/core/history_clusters_service.h"
#include "components/history_clusters/core/url_constants.h"
#include "components/keyed_service/core/service_access_type.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"

#if BUILDFLAG(IS_ANDROID)
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/ui/android/tab_model/tab_model_jni_bridge.h"
#else  // BUILDFLAG(IS_ANDROID)
#include "base/containers/contains.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/ntp_tiles/custom_links_store.h"
#endif  // BUILDFLAG(IS_ANDROID)

namespace {

bool IsPageInTabGroup(content::WebContents* contents) {}

// Pass in a separate `url` parameter to ensure that we check the same URL that
// is being logged in History.
bool IsPageBookmarked(content::WebContents* contents, const GURL& url) {}

base::TimeDelta TimeElapsedBetweenVisits(const history::VisitRow& visit1,
                                         const history::VisitRow& visit2) {}

// Returns with the provided `url` matches the provided `history_url`
// which must be either the basic history URL or history_clusters URL.
bool IsHistoryPage(GURL url, const GURL& history_url) {}

}  // namespace

HistoryClustersTabHelper::HistoryClustersTabHelper(
    content::WebContents* web_contents)
    :{}

HistoryClustersTabHelper::~HistoryClustersTabHelper() = default;

void HistoryClustersTabHelper::OnOmniboxUrlCopied() {}

void HistoryClustersTabHelper::OnOmniboxUrlShared() {}

void HistoryClustersTabHelper::OnUpdatedHistoryForNavigation(
    int64_t navigation_id,
    base::Time timestamp,
    const GURL& url) {}

void HistoryClustersTabHelper::TagNavigationAsExpectingUkmNavigationComplete(
    int64_t navigation_id) {}

history::VisitContextAnnotations
HistoryClustersTabHelper::OnUkmNavigationComplete(
    int64_t navigation_id,
    base::TimeDelta total_foreground_duration,
    const page_load_metrics::PageEndReason page_end_reason) {}

void HistoryClustersTabHelper::DidStartNavigation(
    content::NavigationHandle* navigation_handle) {}

void HistoryClustersTabHelper::DidFinishNavigation(
    content::NavigationHandle* navigation_handle) {}

void HistoryClustersTabHelper::WebContentsDestroyed() {}

void HistoryClustersTabHelper::OnVisibilityChanged(
    content::Visibility visibility) {}

void HistoryClustersTabHelper::StartNewNavigationIfNeeded(
    int64_t navigation_id) {}

void HistoryClustersTabHelper::RecordPageEndMetricsIfNeeded(
    int64_t navigation_id) {}

history_clusters::HistoryClustersService*
HistoryClustersTabHelper::GetHistoryClustersService() {}

history::HistoryService* HistoryClustersTabHelper::GetHistoryService() {}

WEB_CONTENTS_USER_DATA_KEY_IMPL(HistoryClustersTabHelper);