#include "chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.h"
#include <memory>
#include <optional>
#include <string>
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "base/time/time.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/chrome_widget_sublevel.h"
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "components/permissions/features.h"
#include "components/permissions/permission_request.h"
#include "components/permissions/permission_uma_util.h"
#include "components/permissions/request_type.h"
#include "components/strings/grit/components_strings.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/ui_base_features.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_client_view.h"
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(PermissionPromptBubbleBaseView,
kMainViewId);
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(PermissionPromptBubbleBaseView,
kBlockButtonElementId);
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(PermissionPromptBubbleBaseView,
kAllowButtonElementId);
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(PermissionPromptBubbleBaseView,
kAllowOnceButtonElementId);
PermissionPromptBubbleBaseView::PermissionPromptBubbleBaseView(
Browser* browser,
base::WeakPtr<permissions::PermissionPrompt::Delegate> delegate,
base::TimeTicks permission_requested_time,
PermissionPromptStyle prompt_style)
: … { … }
PermissionPromptBubbleBaseView::~PermissionPromptBubbleBaseView() = default;
void PermissionPromptBubbleBaseView::CreatePermissionButtons(
const std::u16string& allow_always_text) { … }
void PermissionPromptBubbleBaseView::CreateExtraTextLabel(
const std::u16string& extra_text) { … }
void PermissionPromptBubbleBaseView::Show() { … }
void PermissionPromptBubbleBaseView::CreateWidget() { … }
void PermissionPromptBubbleBaseView::ShowWidget() { … }
void PermissionPromptBubbleBaseView::UpdateAnchorPosition() { … }
void PermissionPromptBubbleBaseView::SetPromptStyle(
PermissionPromptStyle prompt_style) { … }
bool PermissionPromptBubbleBaseView::ShouldShowCloseButton() const { … }
void PermissionPromptBubbleBaseView::ClosingPermission() { … }
void PermissionPromptBubbleBaseView::RunButtonCallback(int button_id) { … }
std::u16string PermissionPromptBubbleBaseView::GetPermissionFragmentForTesting()
const { … }
bool PermissionPromptBubbleBaseView::IsOneTimePermission(
permissions::PermissionPrompt::Delegate& delegate) { … }
BEGIN_METADATA(…)