#include "components/safe_browsing/content/browser/safe_browsing_navigation_observer.h"
#include <memory>
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "components/page_info/page_info_ui.h"
#include "components/safe_browsing/content/browser/safe_browsing_navigation_observer_manager.h"
#include "components/sessions/content/session_tab_helper.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "net/base/ip_endpoint.h"
#include "url/url_constants.h"
WebContents;
namespace {
const char kWebContentsUserDataKey[] = …;
}
namespace safe_browsing {
NavigationEvent::NavigationEvent()
: … { … }
NavigationEvent::NavigationEvent(NavigationEvent&& nav_event) = default;
NavigationEvent::NavigationEvent(const NavigationEvent& nav_event) = default;
NavigationEvent& NavigationEvent::operator=(NavigationEvent&& nav_event) =
default;
NavigationEvent::~NavigationEvent() = default;
void SafeBrowsingNavigationObserver::MaybeCreateForWebContents(
content::WebContents* web_contents,
HostContentSettingsMap* host_content_settings_map,
SafeBrowsingNavigationObserverManager* observer_manager,
PrefService* prefs,
bool has_safe_browsing_service) { … }
SafeBrowsingNavigationObserver* SafeBrowsingNavigationObserver::FromWebContents(
content::WebContents* web_contents) { … }
SafeBrowsingNavigationObserver::SafeBrowsingNavigationObserver(
content::WebContents* contents,
HostContentSettingsMap* host_content_settings_map,
SafeBrowsingNavigationObserverManager* observer_manager)
: … { … }
SafeBrowsingNavigationObserver::~SafeBrowsingNavigationObserver() = default;
void SafeBrowsingNavigationObserver::OnUserInteraction() { … }
void SafeBrowsingNavigationObserver::DidStartNavigation(
content::NavigationHandle* navigation_handle) { … }
void SafeBrowsingNavigationObserver::DidRedirectNavigation(
content::NavigationHandle* navigation_handle) { … }
void SafeBrowsingNavigationObserver::DidFinishNavigation(
content::NavigationHandle* navigation_handle) { … }
void SafeBrowsingNavigationObserver::DidGetUserInteraction(
const blink::WebInputEvent& event) { … }
void SafeBrowsingNavigationObserver::WebContentsDestroyed() { … }
void SafeBrowsingNavigationObserver::DidOpenRequestedURL(
content::WebContents* new_contents,
content::RenderFrameHost* source_render_frame_host,
const GURL& url,
const content::Referrer& referrer,
WindowOpenDisposition disposition,
ui::PageTransition transition,
bool started_from_context_menu,
bool renderer_initiated) { … }
void SafeBrowsingNavigationObserver::OnContentSettingChanged(
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern,
ContentSettingsTypeSet content_type_set) { … }
void SafeBrowsingNavigationObserver::
SetNavigationInitiationAndRecordUserGesture(
content::NavigationHandle* navigation_handle,
NavigationEvent* nav_event) { … }
void SafeBrowsingNavigationObserver::SetNavigationSourceUrl(
content::NavigationHandle* navigation_handle,
NavigationEvent* nav_event) { … }
void SafeBrowsingNavigationObserver::SetNavigationSourceMainFrameUrl(
content::NavigationHandle* navigation_handle,
NavigationEvent* nav_event) { … }
void SafeBrowsingNavigationObserver::SetNavigationOutermostMainFrameIds(
content::NavigationHandle* navigation_handle,
NavigationEvent* nav_event) { … }
SafeBrowsingNavigationObserverManager*
SafeBrowsingNavigationObserver::GetObserverManager() { … }
void SafeBrowsingNavigationObserver::SetObserverManagerForTesting(
SafeBrowsingNavigationObserverManager* observer_manager) { … }
}