#include <memory>
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/lens/lens_overlay_controller.h"
#include "chrome/browser/ui/permission_bubble/permission_prompt.h"
#include "chrome/browser/ui/tabs/public/tab_features.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/permissions/embedded_permission_prompt.h"
#include "chrome/browser/ui/views/permissions/exclusive_access_permission_prompt.h"
#include "chrome/browser/ui/views/permissions/permission_prompt_bubble.h"
#include "chrome/browser/ui/views/permissions/permission_prompt_chip.h"
#include "chrome/browser/ui/views/permissions/permission_prompt_quiet_icon.h"
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/webui_url_constants.h"
#include "components/permissions/permission_request.h"
#include "components/permissions/permission_uma_util.h"
#include "components/permissions/request_type.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "third_party/blink/public/common/features_generated.h"
#if BUILDFLAG(IS_MAC)
#include "chrome/browser/ui/views/permissions/permission_prompt_notifications_mac.h"
#endif
namespace {
bool IsFullScreenMode(Browser* browser) { … }
LocationBarView* GetLocationBarView(Browser* browser) { … }
bool ShouldIgnorePermissionRequest(
content::WebContents* web_contents,
Browser* browser,
permissions::PermissionPrompt::Delegate* delegate) { … }
bool ShouldUseChip(permissions::PermissionPrompt::Delegate* delegate) { … }
bool IsLocationBarDisplayed(Browser* browser) { … }
bool ShouldCurrentRequestUseQuietChip(
permissions::PermissionPrompt::Delegate* delegate) { … }
bool ShouldCurrentRequestUsePermissionElementSecondaryUI(
permissions::PermissionPrompt::Delegate* delegate) { … }
bool ShouldCurrentRequestUseExclusiveAccessUI(
permissions::PermissionPrompt::Delegate* delegate) { … }
std::unique_ptr<permissions::PermissionPrompt> CreatePwaPrompt(
Browser* browser,
content::WebContents* web_contents,
permissions::PermissionPrompt::Delegate* delegate) { … }
std::unique_ptr<permissions::PermissionPrompt> CreateNormalPrompt(
Browser* browser,
content::WebContents* web_contents,
permissions::PermissionPrompt::Delegate* delegate) { … }
std::unique_ptr<permissions::PermissionPrompt> CreateQuietPrompt(
Browser* browser,
content::WebContents* web_contents,
permissions::PermissionPrompt::Delegate* delegate) { … }
}
std::unique_ptr<permissions::PermissionPrompt> CreatePermissionPrompt(
content::WebContents* web_contents,
permissions::PermissionPrompt::Delegate* delegate) { … }