#include "chrome/browser/ui/views/extensions/extensions_menu_site_permissions_page_view.h"
#include <string>
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "chrome/browser/extensions/permissions/site_permissions_helper.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/controls/hover_button.h"
#include "chrome/browser/ui/views/extensions/extensions_dialogs_utils.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_handler.h"
#include "chrome/grit/generated_resources.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/permissions_manager.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_id.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/image_model.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/button.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/image_button_factory.h"
#include "ui/views/controls/button/radio_button.h"
#include "ui/views/controls/button/toggle_button.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/separator.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/box_layout_view.h"
#include "ui/views/layout/flex_layout_view.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/layout/layout_types.h"
#include "ui/views/metadata/view_factory_internal.h"
#include "ui/views/style/typography.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/view_utils.h"
namespace {
PermissionsManager;
constexpr int kSiteAccessButtonsId = …;
constexpr size_t kOnClickButtonIndex = …;
constexpr size_t kOnSiteButtonIndex = …;
constexpr size_t kOnAllSitesButtonIndex = …;
std::vector<views::RadioButton*> GetSiteAccessButtons(views::View* page) { … }
std::u16string GetShowRequestsToggleAccessibleName(bool is_toggle_on) { … }
std::u16string GetSiteAccessRadioButtonText(
PermissionsManager::UserSiteAccess site_access,
std::u16string current_site = std::u16string()) { … }
std::u16string GetSiteAccessRadioButtonDescription(
PermissionsManager::UserSiteAccess site_access) { … }
int GetSiteAccessButtonIndex(PermissionsManager::UserSiteAccess site_access) { … }
std::unique_ptr<views::ImageView> GetSettingsButtonIcon(int icon_size) { … }
}
ExtensionsMenuSitePermissionsPageView::ExtensionsMenuSitePermissionsPageView(
Browser* browser,
extensions::ExtensionId extension_id,
ExtensionsMenuHandler* menu_handler)
: … { … }
void ExtensionsMenuSitePermissionsPageView::Update(
const std::u16string& extension_name,
const ui::ImageModel& extension_icon,
const std::u16string& current_site,
PermissionsManager::UserSiteAccess user_site_access,
bool is_show_requests_toggle_on,
bool is_on_site_enabled,
bool is_on_all_sites_enabled) { … }
void ExtensionsMenuSitePermissionsPageView::UpdateShowRequestsToggle(
bool is_on) { … }
views::RadioButton*
ExtensionsMenuSitePermissionsPageView::GetSiteAccessButtonForTesting(
PermissionsManager::UserSiteAccess site_access) { … }
BEGIN_METADATA(…)