#include "chrome/browser/ui/views/page_info/page_info_cookies_content_view.h"
#include "base/metrics/histogram_functions.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/page_info/page_info_main_view.h"
#include "chrome/browser/ui/views/page_info/page_info_view_factory.h"
#include "components/content_settings/browser/ui/cookie_controls_util.h"
#include "components/content_settings/core/common/cookie_blocking_3pcd_status.h"
#include "components/content_settings/core/common/cookie_controls_enforcement.h"
#include "components/content_settings/core/common/features.h"
#include "components/privacy_sandbox/privacy_sandbox_features.h"
#include "components/strings/grit/components_strings.h"
#include "components/strings/grit/privacy_sandbox_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/ui_base_features.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/box_layout_view.h"
#include "ui/views/view_class_properties.h"
namespace {
CookieControlsUtil;
TrackingProtectionFeature;
TrackingProtectionFeatureType;
class ThirdPartyCookieLabelWrapper : public views::BoxLayoutView { … };
BEGIN_METADATA(…)
}
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(PageInfoCookiesContentView,
kCookieDialogButton);
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(PageInfoCookiesContentView, kCookiesPage);
PageInfoCookiesContentView::PageInfoCookiesContentView(PageInfo* presenter)
: … { … }
PageInfoCookiesContentView::~PageInfoCookiesContentView() = default;
void PageInfoCookiesContentView::SetInitializedCallbackForTesting(
base::OnceClosure initialized_callback) { … }
void PageInfoCookiesContentView::InitCookiesDialogButton() { … }
void PageInfoCookiesContentView::CookiesSettingsLinkClicked(
const ui::Event& event) { … }
void PageInfoCookiesContentView::SetCookieInfo(
const CookiesNewInfo& cookie_info) { … }
void PageInfoCookiesContentView::SetThirdPartyCookiesTitleAndDescription(
bool protections_on,
CookieControlsEnforcement enforcement,
content_settings::TrackingProtectionBlockingStatus status,
CookieBlocking3pcdStatus blocking_status,
base::Time expiration) { … }
void PageInfoCookiesContentView::SetThirdPartyCookiesToggle(
bool protections_on,
content_settings::TrackingProtectionBlockingStatus status) { … }
void PageInfoCookiesContentView::SetDescriptionLabel(
CookieBlocking3pcdStatus blocking_status,
CookieControlsEnforcement enforcement,
bool is_otr) { … }
void PageInfoCookiesContentView::SetThirdPartyCookiesInfo(
bool protections_on,
bool controls_visible,
CookieBlocking3pcdStatus blocking_status,
base::Time expiration,
TrackingProtectionFeature feature) { … }
void PageInfoCookiesContentView::UpdateBlockingThirdPartyCookiesToggle(
bool are_cookies_blocked) { … }
void PageInfoCookiesContentView::OnToggleButtonPressed() { … }
void PageInfoCookiesContentView::SetRwsCookiesInfo(
std::optional<CookiesRwsInfo> rws_info,
bool is_rws_allowed) { … }
void PageInfoCookiesContentView::InitRwsButton(bool is_managed) { … }
void PageInfoCookiesContentView::RwsSettingsButtonClicked(ui::Event const&) { … }
void PageInfoCookiesContentView::AddThirdPartyCookiesContainer() { … }
std::u16string PageInfoCookiesContentView::GetStatusLabel(
content_settings::TrackingProtectionBlockingStatus blocking_status) { … }