#include "content/browser/webui/web_ui_main_frame_observer.h"
#include <string>
#include <utility>
#include "build/build_config.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/webui/web_ui_impl.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_ui_controller.h"
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "base/feature_list.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "components/crash/content/browser/error_reporting/javascript_error_report.h"
#include "components/crash/content/browser/error_reporting/js_error_report_processor.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/common/url_constants.h"
#include "url/gurl.h"
#endif
namespace content {
namespace {
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
std::string RedactURL(const GURL& url) { … }
#endif
}
WebUIMainFrameObserver::WebUIMainFrameObserver(WebUIImpl* web_ui,
WebContents* contents)
: … { … }
WebUIMainFrameObserver::~WebUIMainFrameObserver() = default;
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
void WebUIMainFrameObserver::OnDidAddMessageToConsole(
RenderFrameHost* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
const std::u16string& message,
int32_t line_no,
const std::u16string& source_id,
const std::optional<std::u16string>& untrusted_stack_trace) { … }
void WebUIMainFrameObserver::MaybeEnableWebUIJavaScriptErrorReporting(
NavigationHandle* navigation_handle) { … }
#endif
void WebUIMainFrameObserver::ReadyToCommitNavigation(
NavigationHandle* navigation_handle) { … }
void WebUIMainFrameObserver::PrimaryPageChanged(Page& page) { … }
}