#include "chrome/browser/ui/views/extensions/extension_install_dialog_view.h"
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/i18n/message_formatter.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_install_prompt_show_params.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "chrome/browser/ui/views/extensions/expandable_container_view.h"
#include "chrome/browser/ui/views/extensions/extension_permissions_view.h"
#include "chrome/common/buildflags.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/constrained_window/constrained_window_views.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/page_navigator.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_urls.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_header_macros.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/geometry/insets.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/border.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/button/checkbox.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/link.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/separator.h"
#include "ui/views/controls/textarea/textarea.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/table_layout.h"
#include "ui/views/widget/widget.h"
OpenURLParams;
Referrer;
namespace {
int g_install_delay_in_ms = …;
enum class CloudExtensionRequestMetricEvent { … };
class RatingsView : public views::View { … };
BEGIN_METADATA(…)
class RatingStar : public views::ImageView { … };
BEGIN_METADATA(…)
class RatingLabel : public views::Label { … };
BEGIN_METADATA(…)
class TitleLabelWrapper : public views::View { … };
BEGIN_METADATA(…)
void AddResourceIcon(const gfx::ImageSkia* skia_image, void* data) { … }
void ShowExtensionInstallDialogImpl(
std::unique_ptr<ExtensionInstallPromptShowParams> show_params,
ExtensionInstallPrompt::DoneCallback done_callback,
std::unique_ptr<ExtensionInstallPrompt::Prompt> prompt) { … }
class CustomScrollableView : public views::View { … };
BEGIN_METADATA(…)
struct ExtensionInfoSection { … };
void AddPermissions(ExtensionInstallPrompt::Prompt* prompt,
std::vector<ExtensionInfoSection>& sections) { … }
}
class ExtensionInstallDialogView::ExtensionJustificationView
: public views::View { … };
BEGIN_METADATA(…)
END_METADATA
ExtensionInstallDialogView::ExtensionInstallDialogView(
std::unique_ptr<ExtensionInstallPromptShowParams> show_params,
ExtensionInstallPrompt::DoneCallback done_callback,
std::unique_ptr<ExtensionInstallPrompt::Prompt> prompt)
: … { … }
ExtensionInstallDialogView::~ExtensionInstallDialogView() { … }
ExtensionInstallPromptShowParams*
ExtensionInstallDialogView::GetShowParamsForTesting() { … }
void ExtensionInstallDialogView::ClickLinkForTesting() { … }
void ExtensionInstallDialogView::SetInstallButtonDelayForTesting(
int delay_in_ms) { … }
bool ExtensionInstallDialogView::IsJustificationFieldVisibleForTesting() { … }
void ExtensionInstallDialogView::SetJustificationTextForTesting(
const std::u16string& new_text) { … }
void ExtensionInstallDialogView::ResizeWidget() { … }
void ExtensionInstallDialogView::VisibilityChanged(views::View* starting_from,
bool is_visible) { … }
void ExtensionInstallDialogView::AddedToWidget() { … }
void ExtensionInstallDialogView::OnDialogCanceled() { … }
void ExtensionInstallDialogView::OnDialogAccepted() { … }
bool ExtensionInstallDialogView::IsDialogButtonEnabled(
ui::mojom::DialogButton button) const { … }
std::u16string ExtensionInstallDialogView::GetAccessibleWindowTitle() const { … }
void ExtensionInstallDialogView::CloseDialog() { … }
void ExtensionInstallDialogView::OnExtensionUninstalled(
content::BrowserContext* browser_context,
const extensions::Extension* extension,
extensions::UninstallReason reason) { … }
void ExtensionInstallDialogView::OnShutdown(
extensions::ExtensionRegistry* registry) { … }
void ExtensionInstallDialogView::LinkClicked() { … }
void ExtensionInstallDialogView::CreateContents() { … }
void ExtensionInstallDialogView::ContentsChanged(
views::Textfield* sender,
const std::u16string& new_contents) { … }
void ExtensionInstallDialogView::EnableInstallButton() { … }
BEGIN_METADATA(…)
ExtensionInstallPrompt::ShowDialogCallback
ExtensionInstallPrompt::GetDefaultShowDialogCallback() { … }