#include "chrome/renderer/net/net_error_helper_core.h"
#include <stddef.h>
#include <memory>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "components/error_page/common/localized_error.h"
#include "content/public/common/content_switches.h"
#include "content/public/renderer/render_thread.h"
#include "net/base/net_errors.h"
#include "url/gurl.h"
namespace {
bool IsNetDnsError(const error_page::Error& error) { … }
}
struct NetErrorHelperCore::ErrorPageInfo { … };
NetErrorHelperCore::NetErrorHelperCore(Delegate* delegate)
: … { … }
NetErrorHelperCore::~NetErrorHelperCore() = default;
void NetErrorHelperCore::OnCommitLoad(FrameType frame_type, const GURL& url) { … }
void NetErrorHelperCore::ErrorPageLoadedWithFinalErrorCode() { … }
void NetErrorHelperCore::OnFinishLoad(FrameType frame_type) { … }
void NetErrorHelperCore::PrepareErrorPage(
FrameType frame_type,
const error_page::Error& error,
bool is_failed_post,
content::mojom::AlternativeErrorPageOverrideInfoPtr
alternative_error_page_info,
std::string* error_html) { … }
void NetErrorHelperCore::OnNetErrorInfo(error_page::DnsProbeStatus status) { … }
void NetErrorHelperCore::OnSetCanShowNetworkDiagnosticsDialog(
bool can_show_network_diagnostics_dialog) { … }
void NetErrorHelperCore::OnEasterEggHighScoreReceived(int high_score) { … }
void NetErrorHelperCore::PrepareErrorPageForMainFrame(
ErrorPageInfo* pending_error_page_info,
content::mojom::AlternativeErrorPageOverrideInfoPtr
alternative_error_page_info,
std::string* error_html) { … }
void NetErrorHelperCore::UpdateErrorPage() { … }
error_page::Error NetErrorHelperCore::GetUpdatedError(
const ErrorPageInfo& error_info) const { … }
void NetErrorHelperCore::Reload() { … }
#if BUILDFLAG(IS_ANDROID)
void NetErrorHelperCore::SetPageAutoFetcherHelperForTesting(
std::unique_ptr<PageAutoFetcherHelper> page_auto_fetcher_helper) {
page_auto_fetcher_helper_ = std::move(page_auto_fetcher_helper);
}
#endif
void NetErrorHelperCore::ExecuteButtonPress(Button button) { … }
void NetErrorHelperCore::LaunchOfflineItem(const std::string& id,
const std::string& name_space) { … }
void NetErrorHelperCore::LaunchDownloadsPage() { … }
void NetErrorHelperCore::SavePageForLater() { … }
void NetErrorHelperCore::CancelSavePage() { … }
void NetErrorHelperCore::ListVisibilityChanged(bool is_visible) { … }