#include "chrome/browser/ui/views/site_data/page_specific_site_data_dialog.h"
#include <memory>
#include <string>
#include "base/feature_list.h"
#include "base/functional/overloaded.h"
#include "base/metrics/user_metrics_action.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/privacy_sandbox/tracking_protection_settings_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/site_data/page_specific_site_data_dialog_controller.h"
#include "chrome/browser/ui/views/site_data/site_data_row_view.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/browsing_data/content/browsing_data_model.h"
#include "components/browsing_data/core/browsing_data_utils.h"
#include "components/constrained_window/constrained_window_views.h"
#include "components/content_settings/browser/page_specific_content_settings.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "components/omnibox/browser/favicon_cache.h"
#include "components/privacy_sandbox/privacy_sandbox_features.h"
#include "components/privacy_sandbox/tracking_protection_settings.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/browsing_data_filter_builder.h"
#include "content/public/browser/browsing_data_remover.h"
#include "content/public/browser/web_contents.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/cookies/cookie_util.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/dialog_model.h"
#include "ui/views/bubble/bubble_dialog_model_host.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/layout/box_layout_view.h"
#include "ui/views/view_class_properties.h"
#include "url/origin.h"
namespace {
struct PageSpecificSiteDataDialogSection { … };
int GetContentSettingRowOrder(ContentSetting setting) { … }
std::string GetEtldPlusOne(const url::Origin& origin) { … }
std::vector<PageSpecificSiteDataDialogSection> GetSections(
std::vector<PageSpecificSiteDataDialogSite> all_sites,
const url::Origin& current_origin) { … }
std::unique_ptr<views::BubbleDialogModelHost::CustomView> CreateCustomField(
std::unique_ptr<views::View> view) { … }
class PageSpecificSiteDataDialogModelDelegate : public ui::DialogModelDelegate { … };
class PageSpecificSiteDataSectionView : public views::BoxLayoutView { … };
}
namespace test {
PageSpecificSiteDataDialogTestApi::PageSpecificSiteDataDialogTestApi(
content::WebContents* web_contents)
: … { … }
PageSpecificSiteDataDialogTestApi::~PageSpecificSiteDataDialogTestApi() =
default;
void PageSpecificSiteDataDialogTestApi::SetBrowsingDataModels(
BrowsingDataModel* allowed,
BrowsingDataModel* blocked) { … }
std::vector<PageSpecificSiteDataDialogSite>
PageSpecificSiteDataDialogTestApi::GetAllSites() { … }
void PageSpecificSiteDataDialogTestApi::DeleteStoredObjects(
const url::Origin& origin) { … }
}
DEFINE_ELEMENT_IDENTIFIER_VALUE(kPageSpecificSiteDataDialogRow);
DEFINE_ELEMENT_IDENTIFIER_VALUE(kPageSpecificSiteDataDialogFirstPartySection);
DEFINE_ELEMENT_IDENTIFIER_VALUE(kPageSpecificSiteDataDialogThirdPartySection);
DEFINE_ELEMENT_IDENTIFIER_VALUE(kPageSpecificSiteDataDialogEmptyStateLabel);
views::Widget* ShowPageSpecificSiteDataDialog(
content::WebContents* web_contents) { … }