chromium/chrome/browser/apps/link_capturing/link_capturing_navigation_throttle.cc

// Copyright 2023 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/apps/link_capturing/link_capturing_navigation_throttle.h"

#include <utility>

#include "base/memory/ptr_util.h"
#include "base/no_destructor.h"
#include "base/task/single_thread_task_runner.h"
#include "base/types/cxx23_to_underlying.h"
#include "chrome/browser/apps/link_capturing/link_capturing_features.h"
#include "chrome/browser/apps/link_capturing/link_capturing_tab_data.h"
#include "chrome/browser/preloading/prefetch/no_state_prefetch/chrome_no_state_prefetch_contents_delegate.h"  // nogncheck https://crbug.com/1474116
#include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h"  // nogncheck https://crbug.com/1474116
#include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h"  // nogncheck https://crbug.com/1474116
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_finder.h"  // nogncheck https://crbug.com/1474984
#include "chrome/browser/web_applications/web_app_ui_manager.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "components/keep_alive_registry/keep_alive_types.h"
#include "components/keep_alive_registry/scoped_keep_alive.h"
#include "components/page_load_metrics/browser/page_load_metrics_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "extensions/common/constants.h"
#include "url/origin.h"

namespace apps {

namespace {

ThrottleCheckResult;

// Retrieves the 'starting' url for the given navigation handle. This considers
// the referrer url, last committed url, and the initiator origin.
GURL GetStartingUrl(content::NavigationHandle* navigation_handle) {}

// Returns if the navigation appears to be a link navigation, but not from an
// HTML post form.
bool IsNavigateFromNonFormNonContextMenuLink(
    content::NavigationHandle* navigation_handle) {}

bool IsNavigationUserInitiated(content::NavigationHandle* handle) {}

}  // namespace

bool LinkCapturingNavigationThrottle::IsCapturableLinkNavigation(
    ui::PageTransition page_transition,
    bool allow_form_submit,
    bool is_in_fenced_frame_tree,
    bool has_user_gesture) {}

ui::PageTransition LinkCapturingNavigationThrottle::MaskOutPageTransition(
    ui::PageTransition page_transition,
    ui::PageTransition mask) {}

// static
bool LinkCapturingNavigationThrottle::
    IsEmptyDanglingWebContentsAfterLinkCapture(
        content::NavigationHandle* handle) {}

LinkCapturingNavigationThrottle::Delegate::~Delegate() = default;

// static
std::unique_ptr<content::NavigationThrottle>
LinkCapturingNavigationThrottle::MaybeCreate(
    content::NavigationHandle* handle,
    std::unique_ptr<Delegate> delegate) {}

LinkCapturingNavigationThrottle::LaunchCallbackForTesting&
LinkCapturingNavigationThrottle::GetLinkCaptureLaunchCallbackForTesting() {}

LinkCapturingNavigationThrottle::~LinkCapturingNavigationThrottle() = default;

const char* LinkCapturingNavigationThrottle::GetNameForLogging() {}

ThrottleCheckResult LinkCapturingNavigationThrottle::WillStartRequest() {}

ThrottleCheckResult LinkCapturingNavigationThrottle::WillRedirectRequest() {}

// Returns true if |url| is a known and valid redirector that will redirect a
// navigation elsewhere.
// static
bool LinkCapturingNavigationThrottle::IsGoogleRedirectorUrl(const GURL& url) {}

// If the previous url and current url are not the same (AKA a redirection),
// determines if the redirection should be considered for an app launch. Returns
// false for redirections where:
// * `previous_url` is an extension.
// * `previous_url` is a google redirector.
// static
bool LinkCapturingNavigationThrottle::ShouldOverrideUrlIfRedirected(
    const GURL& previous_url,
    const GURL& current_url) {}

ThrottleCheckResult LinkCapturingNavigationThrottle::HandleRequest() {}

LinkCapturingNavigationThrottle::LinkCapturingNavigationThrottle(
    content::NavigationHandle* navigation_handle,
    std::unique_ptr<Delegate> delegate)
    :{}

}  // namespace apps