#ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSIONS_DIALOGS_H_
#define CHROME_BROWSER_UI_EXTENSIONS_EXTENSIONS_DIALOGS_H_
#include <memory>
#include <string>
#include "base/functional/callback_forward.h"
#include "build/build_config.h"
#include "chrome/browser/ui/extensions/mv2_disabled_dialog_controller.h"
#include "extensions/common/extension_id.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/native_ui_types.h"
#if BUILDFLAG(IS_CHROMEOS)
#include "base/files/safe_base_name.h"
#endif
class Browser;
class ControlledHomeDialogControllerInterface;
class SettingsOverriddenDialogController;
class Profile;
namespace content {
class WebContents;
}
namespace gfx {
class ImageSkia;
}
namespace permissions {
class ChooserController;
}
namespace extensions {
class Extension;
DECLARE_ELEMENT_IDENTIFIER_VALUE(kControlledHomeDialogCancelButtonElementId);
DECLARE_ELEMENT_IDENTIFIER_VALUE(kExtensionInstallFrictionLearnMoreLink);
DECLARE_ELEMENT_IDENTIFIER_VALUE(kMv2DisabledDialogManageButtonElementId);
DECLARE_ELEMENT_IDENTIFIER_VALUE(kMv2DisabledDialogParagraphElementId);
DECLARE_ELEMENT_IDENTIFIER_VALUE(kMv2DisabledDialogRemoveButtonElementId);
DECLARE_ELEMENT_IDENTIFIER_VALUE(kMv2KeepDialogOkButtonElementId);
DECLARE_ELEMENT_IDENTIFIER_VALUE(kParentBlockedDialogMessage);
void ShowConstrainedDeviceChooserDialog(
content::WebContents* web_contents,
std::unique_ptr<permissions::ChooserController> controller);
void ShowExtensionInstallBlockedDialog(
const ExtensionId& extension_id,
const std::string& extension_name,
const std::u16string& custom_error_message,
const gfx::ImageSkia& icon,
content::WebContents* web_contents,
base::OnceClosure done_callback);
void ShowControlledHomeDialog(
Profile* profile,
gfx::NativeWindow parent,
std::unique_ptr<ControlledHomeDialogControllerInterface> controller);
void ShowDownloadOpenConfirmationDialog(
content::WebContents* web_contents,
const std::string& extension_name,
const base::FilePath& file_path,
base::OnceCallback<void(bool)> open_callback);
void ShowExtensionInstallFrictionDialog(
content::WebContents* contents,
base::OnceCallback<void(bool)> callback);
void ShowExtensionMultipleUninstallDialog(
Profile* profile,
gfx::NativeWindow parent,
const std::vector<ExtensionId>& extension_ids,
base::OnceClosure accept_callback,
base::OnceClosure cancel_callback);
void ShowMv2DeprecationDisabledDialog(
Browser* browser,
std::vector<Mv2DisabledDialogController::ExtensionInfo>& extensions_info,
base::OnceClosure remove_callback,
base::OnceClosure manage_callback,
base::OnceClosure close_callback);
void ShowMv2DeprecationKeepDialog(Browser* browser,
const Extension& extension,
base::OnceClosure accept_callback,
base::OnceClosure cancel_callback);
void ShowMv2DeprecationReEnableDialog(
gfx::NativeWindow parent,
const ExtensionId& extension_id,
const std::string& extension_name,
base::OnceCallback<void(bool)> done_callback);
void ShowSettingsOverriddenDialog(
std::unique_ptr<SettingsOverriddenDialogController> controller,
gfx::NativeWindow parent);
enum class ExtensionInstalledBlockedByParentDialogAction {
kAdd,
kEnable,
};
void ShowExtensionInstallBlockedByParentDialog(
ExtensionInstalledBlockedByParentDialogAction action,
const Extension* extension,
content::WebContents* web_contents,
base::OnceClosure done_callback);
void ShowUploadExtensionToAccountDialog(Browser* browser,
const Extension& extension,
base::OnceClosure accept_callback,
base::OnceClosure cancel_callback);
#if BUILDFLAG(IS_CHROMEOS)
void ShowDocumentScannerDiscoveryConfirmationDialog(
gfx::NativeWindow parent,
const ExtensionId& extension_id,
const std::u16string& extension_name,
const gfx::ImageSkia& extension_icon,
base::OnceCallback<void(bool)> callback);
void ShowDocumentScannerStartScanConfirmationDialog(
gfx::NativeWindow parent,
const ExtensionId& extension_id,
const std::u16string& extension_name,
const std::u16string& scanner_name,
const gfx::ImageSkia& extension_icon,
base::OnceCallback<void(bool)> callback);
void ShowRequestFileSystemDialog(
content::WebContents* web_contents,
const std::string& extension_name,
const std::string& volume_label,
bool writable,
base::OnceCallback<void(ui::mojom::DialogButton)> callback);
void ShowPrintJobConfirmationDialog(gfx::NativeWindow parent,
const ExtensionId& extension_id,
const std::u16string& extension_name,
const gfx::ImageSkia& extension_icon,
const std::u16string& print_job_title,
const std::u16string& printer_name,
base::OnceCallback<void(bool)> callback);
#endif
}
#endif