#include "chrome/browser/ui/views/page_info/page_info_view_factory.h"
#include <memory>
#include <string>
#include "base/feature_list.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/page_info/page_info_features.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/page_info/chrome_page_info_ui_delegate.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/page_info/page_info_ad_personalization_content_view.h"
#include "chrome/browser/ui/views/page_info/page_info_cookies_content_view.h"
#include "chrome/browser/ui/views/page_info/page_info_main_view.h"
#include "chrome/browser/ui/views/page_info/page_info_navigation_handler.h"
#include "chrome/browser/ui/views/page_info/page_info_permission_content_view.h"
#include "chrome/browser/ui/views/page_info/page_info_security_content_view.h"
#include "components/page_info/core/features.h"
#include "components/page_info/core/proto/about_this_site_metadata.pb.h"
#include "components/page_info/page_info.h"
#include "components/permissions/permission_util.h"
#include "components/privacy_sandbox/privacy_sandbox_features.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/color/color_id.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/image_button_factory.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/controls/separator.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/vector_icons.h"
constexpr int PageInfoViewFactory::kMinBubbleWidth;
constexpr int PageInfoViewFactory::kMaxBubbleWidth;
namespace {
class PageInfoSubpageView : public views::View { … };
int GetIconSize() { … }
}
std::unique_ptr<views::View> PageInfoViewFactory::CreateSeparator(
int horizontal_inset) { … }
std::unique_ptr<views::View> PageInfoViewFactory::CreateLabelWrapper() { … }
PageInfoViewFactory::PageInfoViewFactory(
PageInfo* presenter,
ChromePageInfoUiDelegate* ui_delegate,
PageInfoNavigationHandler* navigation_handler,
PageInfoHistoryController* history_controller)
: … { … }
std::unique_ptr<views::View> PageInfoViewFactory::CreateMainPageView(
base::OnceClosure initialized_callback) { … }
std::unique_ptr<views::View> PageInfoViewFactory::CreateSecurityPageView() { … }
std::unique_ptr<views::View> PageInfoViewFactory::CreatePermissionPageView(
ContentSettingsType type,
content::WebContents* web_contents) { … }
std::unique_ptr<views::View>
PageInfoViewFactory::CreateAdPersonalizationPageView() { … }
std::unique_ptr<views::View> PageInfoViewFactory::CreateCookiesPageView() { … }
std::unique_ptr<views::View> PageInfoViewFactory::CreateSubpageHeader(
std::u16string title,
std::u16string subtitle) { … }
const ui::ImageModel PageInfoViewFactory::GetPermissionIcon(
const PageInfo::PermissionInfo& info,
bool blocked_on_system_level) { … }
const ui::ImageModel PageInfoViewFactory::GetChosenObjectIcon(
const PageInfoUI::ChosenObjectInfo& object,
bool deleted) { … }
const ui::ImageModel PageInfoViewFactory::GetValidCertificateIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetInvalidCertificateIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetSiteSettingsIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetVrSettingsIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetLaunchIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetConnectionNotSecureIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetConnectionDangerousIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetConnectionSecureIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetOpenSubpageIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetAboutThisSiteIcon() { … }
const gfx::VectorIcon& PageInfoViewFactory::GetAboutThisSiteColorVectorIcon() { … }
const gfx::VectorIcon& PageInfoViewFactory::GetAboutThisSiteVectorIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetHistoryIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetAdPersonalizationIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetManagedPermissionIcon(
const PageInfo::PermissionInfo& info) { … }
const ui::ImageModel PageInfoViewFactory::GetThirdPartyCookiesIcon(
bool third_party_cookies_enabled) { … }
const ui::ImageModel PageInfoViewFactory::GetBlockingThirdPartyCookiesIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetBusinessIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetCookiesAndSiteDataIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetRwsIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetEnforcedByPolicyIcon() { … }
const ui::ImageModel PageInfoViewFactory::GetImageModel(
const gfx::VectorIcon& icon) { … }