#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"
#include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h"
#include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_finder.h"
#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;
GURL GetStartingUrl(content::NavigationHandle* navigation_handle) { … }
bool IsNavigateFromNonFormNonContextMenuLink(
content::NavigationHandle* navigation_handle) { … }
bool IsNavigationUserInitiated(content::NavigationHandle* handle) { … }
}
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) { … }
bool LinkCapturingNavigationThrottle::
IsEmptyDanglingWebContentsAfterLinkCapture(
content::NavigationHandle* handle) { … }
LinkCapturingNavigationThrottle::Delegate::~Delegate() = default;
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() { … }
bool LinkCapturingNavigationThrottle::IsGoogleRedirectorUrl(const GURL& url) { … }
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)
: … { … }
}