#include "chrome/browser/ui/views/hung_renderer_view.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/i18n/rtl.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/supports_user_data.h"
#include "build/build_config.h"
#include "chrome/browser/hang_monitor/hang_crash_dump.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h"
#include "chrome/browser/ui/hung_renderer/hung_renderer_core.h"
#include "chrome/browser/ui/tab_contents/core_tab_helper.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
#include "components/constrained_window/constrained_window_views.h"
#include "components/favicon/content/content_favicon_driver.h"
#include "components/web_modal/web_contents_modal_dialog_host.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/result_codes.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/widget/widget.h"
WebContents;
HungPagesTableModel::HungPagesTableModel(Delegate* delegate)
: … { … }
HungPagesTableModel::~HungPagesTableModel() = default;
content::RenderWidgetHost* HungPagesTableModel::GetRenderWidgetHost() { … }
void HungPagesTableModel::InitForWebContents(
WebContents* contents,
content::RenderWidgetHost* render_widget_host,
base::RepeatingClosure hang_monitor_restarter) { … }
void HungPagesTableModel::Reset() { … }
void HungPagesTableModel::RestartHangMonitorTimeout() { … }
size_t HungPagesTableModel::RowCount() { … }
std::u16string HungPagesTableModel::GetText(size_t row, int column_id) { … }
ui::ImageModel HungPagesTableModel::GetIcon(size_t row) { … }
void HungPagesTableModel::SetObserver(ui::TableModelObserver* observer) { … }
void HungPagesTableModel::RenderProcessExited(
content::RenderProcessHost* host,
const content::ChildProcessTerminationInfo& info) { … }
void HungPagesTableModel::RenderWidgetHostDestroyed(
content::RenderWidgetHost* widget_host) { … }
void HungPagesTableModel::TabDestroyed(WebContentsObserverImpl* tab) { … }
void HungPagesTableModel::TabUpdated(WebContentsObserverImpl* tab) { … }
HungPagesTableModel::WebContentsObserverImpl::WebContentsObserverImpl(
HungPagesTableModel* model,
WebContents* tab)
: … { … }
void HungPagesTableModel::WebContentsObserverImpl::RenderFrameHostChanged(
content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) { … }
void HungPagesTableModel::WebContentsObserverImpl::WebContentsDestroyed() { … }
namespace {
constexpr int kTableViewWidth = …;
constexpr int kTableViewHeight = …;
}
namespace {
constexpr int kDialogHolderUserDataKey = …;
struct DialogHolder : public base::SupportsUserData::Data { … };
static bool g_bypass_active_browser_requirement = …;
}
void HungRendererDialogView::Show(
WebContents* contents,
content::RenderWidgetHost* render_widget_host,
base::RepeatingClosure hang_monitor_restarter) { … }
void HungRendererDialogView::Hide(
WebContents* contents,
content::RenderWidgetHost* render_widget_host) { … }
bool HungRendererDialogView::IsShowingForWebContents(WebContents* contents) { … }
HungRendererDialogView::HungRendererDialogView(WebContents* web_contents)
: … { … }
HungRendererDialogView::~HungRendererDialogView() { … }
HungRendererDialogView* HungRendererDialogView::CreateInstance(
WebContents* contents,
gfx::NativeWindow window) { … }
HungRendererDialogView*
HungRendererDialogView::GetInstanceForWebContentsForTests(
WebContents* contents) { … }
void HungRendererDialogView::ShowDialog(
content::RenderWidgetHost* render_widget_host,
base::RepeatingClosure hang_monitor_restarter) { … }
void HungRendererDialogView::EndDialog(
content::RenderWidgetHost* render_widget_host) { … }
std::u16string HungRendererDialogView::GetWindowTitle() const { … }
bool HungRendererDialogView::ShouldShowCloseButton() const { … }
void HungRendererDialogView::TabUpdated() { … }
void HungRendererDialogView::TabDestroyed() { … }
void HungRendererDialogView::RestartHangTimer() { … }
void HungRendererDialogView::ForceCrashHungRenderer() { … }
void HungRendererDialogView::ResetWebContentsAssociation() { … }
void HungRendererDialogView::UpdateLabels() { … }
void HungRendererDialogView::CloseDialogWithNoAction() { … }
void HungRendererDialogView::BypassActiveBrowserRequirementForTests() { … }
BEGIN_METADATA(…)