#include "chrome/browser/navigation_predictor/navigation_predictor_keyed_service.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/json/json_writer.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/histogram_macros_local.h"
#include "base/observer_list.h"
#include "base/time/default_tick_clock.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "third_party/blink/public/mojom/devtools/console_message.mojom.h"
namespace {
void WritePredictionToConsoleLog(
const NavigationPredictorKeyedService::Prediction& prediction) { … }
}
NavigationPredictorKeyedService::Prediction::Prediction(
content::WebContents* web_contents,
const std::optional<GURL>& source_document_url,
PredictionSource prediction_source,
const std::vector<GURL>& sorted_predicted_urls)
: … { … }
NavigationPredictorKeyedService::Prediction::Prediction(
const NavigationPredictorKeyedService::Prediction& other)
: … { … }
NavigationPredictorKeyedService::Prediction&
NavigationPredictorKeyedService::Prediction::operator=(
const NavigationPredictorKeyedService::Prediction& other) { … }
NavigationPredictorKeyedService::Prediction::~Prediction() = default;
const std::optional<GURL>&
NavigationPredictorKeyedService::Prediction::source_document_url() const { … }
const std::vector<GURL>&
NavigationPredictorKeyedService::Prediction::sorted_predicted_urls() const { … }
content::WebContents*
NavigationPredictorKeyedService::Prediction::web_contents() const { … }
NavigationPredictorKeyedService::NavigationPredictorKeyedService(
content::BrowserContext* browser_context)
: … { … }
NavigationPredictorKeyedService::~NavigationPredictorKeyedService() { … }
void NavigationPredictorKeyedService::OnPredictionUpdated(
content::WebContents* web_contents,
const GURL& document_url,
PredictionSource prediction_source,
const std::vector<GURL>& sorted_predicted_urls) { … }
void NavigationPredictorKeyedService::AddObserver(Observer* observer) { … }
void NavigationPredictorKeyedService::RemoveObserver(Observer* observer) { … }
void NavigationPredictorKeyedService::OnWebContentsVisibilityChanged(
content::WebContents* web_contents,
bool is_in_foreground) { … }
void NavigationPredictorKeyedService::OnWebContentsDestroyed(
content::WebContents* web_contents) { … }
bool NavigationPredictorKeyedService::IsBrowserAppLikelyInForeground() const { … }
void NavigationPredictorKeyedService::SetTickClockForTesting(
const base::TickClock* tick_clock) { … }
SearchEnginePreconnector*
NavigationPredictorKeyedService::search_engine_preconnector() { … }