#include "chrome/browser/extensions/extension_disabled_ui.h"
#include <memory>
#include <string>
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/scoped_observation.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/extensions/extension_install_error_menu_item_id_provider.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_uninstall_dialog.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/global_error/global_error.h"
#include "chrome/browser/ui/global_error/global_error_service.h"
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/grit/generated_resources.h"
#include "components/strings/grit/components_strings.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_registry_observer.h"
#include "extensions/browser/extension_util.h"
#include "extensions/browser/image_loader.h"
#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/extension.h"
#include "extensions/common/icons/extension_icon_set.h"
#include "extensions/common/permissions/permission_message.h"
#include "extensions/common/permissions/permissions_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/geometry/size.h"
namespace extensions {
class ExtensionDisabledGlobalError final
: public GlobalErrorWithStandardBubble,
public ExtensionUninstallDialog::Delegate,
public ExtensionRegistryObserver { … };
ExtensionDisabledGlobalError::ExtensionDisabledGlobalError(
ExtensionService* service,
const Extension* extension,
bool is_remote_install)
: … { … }
ExtensionDisabledGlobalError::~ExtensionDisabledGlobalError() { … }
GlobalError::Severity ExtensionDisabledGlobalError::GetSeverity() { … }
bool ExtensionDisabledGlobalError::HasMenuItem() { … }
int ExtensionDisabledGlobalError::MenuItemCommandID() { … }
std::u16string ExtensionDisabledGlobalError::MenuItemLabel() { … }
void ExtensionDisabledGlobalError::ExecuteMenuItem(Browser* browser) { … }
std::u16string ExtensionDisabledGlobalError::GetBubbleViewTitle() { … }
std::vector<std::u16string>
ExtensionDisabledGlobalError::GetBubbleViewMessages() { … }
std::u16string ExtensionDisabledGlobalError::GetBubbleViewAcceptButtonLabel() { … }
std::u16string ExtensionDisabledGlobalError::GetBubbleViewCancelButtonLabel() { … }
void ExtensionDisabledGlobalError::BubbleViewAcceptButtonPressed(
Browser* browser) { … }
void ExtensionDisabledGlobalError::BubbleViewCancelButtonPressed(
Browser* browser) { … }
base::WeakPtr<GlobalErrorWithStandardBubble>
ExtensionDisabledGlobalError::AsWeakPtr() { … }
bool ExtensionDisabledGlobalError::ShouldCloseOnDeactivate() const { … }
bool ExtensionDisabledGlobalError::ShouldShowCloseButton() const { … }
void ExtensionDisabledGlobalError::OnExtensionUninstallDialogClosed(
bool did_start_uninstall,
const std::u16string& error) { … }
void ExtensionDisabledGlobalError::OnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) { … }
void ExtensionDisabledGlobalError::OnExtensionUninstalled(
content::BrowserContext* browser_context,
const Extension* extension,
UninstallReason reason) { … }
void ExtensionDisabledGlobalError::OnShutdown(ExtensionRegistry* registry) { … }
void ExtensionDisabledGlobalError::RemoveGlobalError() { … }
void AddExtensionDisabledError(ExtensionService* service,
const Extension* extension,
bool is_remote_install) { … }
}