#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome.mojom-params-data.h"
#include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome.mojom-shared-message-ids.h"
#include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome.mojom-import-headers.h"
#include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome.mojom-test-utils.h"
namespace side_panel::mojom {
BackgroundImage::BackgroundImage()
: … { … }
BackgroundImage::BackgroundImage(
const ::GURL& url_in,
const ::GURL& snapshot_url_in,
bool is_uploaded_image_in,
const std::optional<::base::Token>& local_background_id_in,
const std::string& title_in,
const std::string& collection_id_in,
bool daily_refresh_enabled_in)
: … { … }
BackgroundImage::~BackgroundImage() = default;
void BackgroundImage::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool BackgroundImage::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
ThirdPartyThemeInfo::ThirdPartyThemeInfo()
: … { … }
ThirdPartyThemeInfo::ThirdPartyThemeInfo(
const std::string& id_in,
const std::string& name_in)
: … { … }
ThirdPartyThemeInfo::~ThirdPartyThemeInfo() = default;
size_t ThirdPartyThemeInfo::Hash(size_t seed) const { … }
void ThirdPartyThemeInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ThirdPartyThemeInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
Theme::Theme()
: … { … }
Theme::Theme(
BackgroundImagePtr background_image_in,
ThirdPartyThemeInfoPtr third_party_theme_info_in,
::SkColor background_color_in,
std::optional<::SkColor> foreground_color_in,
bool background_managed_by_policy_in,
bool follow_device_theme_in)
: … { … }
Theme::~Theme() = default;
void Theme::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool Theme::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
BackgroundCollection::BackgroundCollection()
: … { … }
BackgroundCollection::BackgroundCollection(
const std::string& id_in,
const std::string& label_in,
const ::GURL& preview_image_url_in)
: … { … }
BackgroundCollection::~BackgroundCollection() = default;
void BackgroundCollection::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool BackgroundCollection::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CollectionImage::CollectionImage()
: … { … }
CollectionImage::CollectionImage(
const std::string& attribution_1_in,
const std::string& attribution_2_in,
const ::GURL& attribution_url_in,
const ::GURL& image_url_in,
const ::GURL& preview_image_url_in,
const std::string& collection_id_in)
: … { … }
CollectionImage::~CollectionImage() = default;
void CollectionImage::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CollectionImage::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
ModuleSettings::ModuleSettings()
: … { … }
ModuleSettings::ModuleSettings(
const std::string& id_in,
const std::string& name_in,
bool enabled_in)
: … { … }
ModuleSettings::~ModuleSettings() = default;
size_t ModuleSettings::Hash(size_t seed) const { … }
void ModuleSettings::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ModuleSettings::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char CustomizeChromePageHandlerFactory::Name_[] = …;
CustomizeChromePageHandlerFactory::IPCStableHashFunction CustomizeChromePageHandlerFactory::MessageToMethodInfo_(mojo::Message& message) { … }
const char* CustomizeChromePageHandlerFactory::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t CustomizeChromePageHandlerFactory::CreatePageHandler_Sym::IPCStableHash() { … }
# endif
CustomizeChromePageHandlerFactoryProxy::CustomizeChromePageHandlerFactoryProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void CustomizeChromePageHandlerFactoryProxy::CreatePageHandler(
::mojo::PendingRemote<CustomizeChromePage> in_page, ::mojo::PendingReceiver<CustomizeChromePageHandler> in_handler) { … }
bool CustomizeChromePageHandlerFactoryStubDispatch::Accept(
CustomizeChromePageHandlerFactory* impl,
mojo::Message* message) { … }
bool CustomizeChromePageHandlerFactoryStubDispatch::AcceptWithResponder(
CustomizeChromePageHandlerFactory* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kCustomizeChromePageHandlerFactoryValidationInfo[] = …;
bool CustomizeChromePageHandlerFactoryRequestValidator::Accept(mojo::Message* message) { … }
const char CustomizeChromePageHandler::Name_[] = …;
CustomizeChromePageHandler::IPCStableHashFunction CustomizeChromePageHandler::MessageToMethodInfo_(mojo::Message& message) { … }
const char* CustomizeChromePageHandler::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t CustomizeChromePageHandler::SetMostVisitedSettings_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::UpdateMostVisitedSettings_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::GetBackgroundCollections_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::GetBackgroundImages_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::UpdateModulesSettings_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::UpdateTheme_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::SetDefaultColor_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::SetFollowDeviceTheme_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::RemoveBackgroundImage_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::ChooseLocalCustomBackground_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::SetBackgroundImage_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::SetDailyRefreshCollectionId_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::OpenChromeWebStore_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::OpenChromeWebStoreHomePage_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::OpenThirdPartyThemePage_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::OpenChromeWebStoreCategoryPage_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::OpenChromeWebStoreCollectionPage_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::OpenNtpManagedByPage_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::SetModulesVisible_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::SetModuleDisabled_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::UpdateScrollToSection_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::UpdateAttachedTabState_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePageHandler::UpdateNtpManagedByName_Sym::IPCStableHash() { … }
# endif
class CustomizeChromePageHandler_GetBackgroundCollections_ForwardToCallback
: public mojo::MessageReceiver { … };
class CustomizeChromePageHandler_GetBackgroundImages_ForwardToCallback
: public mojo::MessageReceiver { … };
class CustomizeChromePageHandler_ChooseLocalCustomBackground_ForwardToCallback
: public mojo::MessageReceiver { … };
CustomizeChromePageHandlerProxy::CustomizeChromePageHandlerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void CustomizeChromePageHandlerProxy::SetMostVisitedSettings(
bool in_custom_links_enabled, bool in_shortcuts_visible) { … }
void CustomizeChromePageHandlerProxy::UpdateMostVisitedSettings(
) { … }
void CustomizeChromePageHandlerProxy::GetBackgroundCollections(
GetBackgroundCollectionsCallback callback) { … }
void CustomizeChromePageHandlerProxy::GetBackgroundImages(
const std::string& in_collection_id, GetBackgroundImagesCallback callback) { … }
void CustomizeChromePageHandlerProxy::UpdateModulesSettings(
) { … }
void CustomizeChromePageHandlerProxy::UpdateTheme(
) { … }
void CustomizeChromePageHandlerProxy::SetDefaultColor(
) { … }
void CustomizeChromePageHandlerProxy::SetFollowDeviceTheme(
bool in_follow) { … }
void CustomizeChromePageHandlerProxy::RemoveBackgroundImage(
) { … }
void CustomizeChromePageHandlerProxy::ChooseLocalCustomBackground(
ChooseLocalCustomBackgroundCallback callback) { … }
void CustomizeChromePageHandlerProxy::SetBackgroundImage(
const std::string& in_attribution_1, const std::string& in_attribution_2, const ::GURL& in_attribution_url, const ::GURL& in_image_url, const ::GURL& in_thumbnail_url, const std::string& in_collection_id) { … }
void CustomizeChromePageHandlerProxy::SetDailyRefreshCollectionId(
const std::string& in_collection_id) { … }
void CustomizeChromePageHandlerProxy::OpenChromeWebStore(
) { … }
void CustomizeChromePageHandlerProxy::OpenChromeWebStoreHomePage(
) { … }
void CustomizeChromePageHandlerProxy::OpenThirdPartyThemePage(
const std::string& in_theme_id) { … }
void CustomizeChromePageHandlerProxy::OpenChromeWebStoreCategoryPage(
ChromeWebStoreCategory in_category) { … }
void CustomizeChromePageHandlerProxy::OpenChromeWebStoreCollectionPage(
ChromeWebStoreCollection in_collection) { … }
void CustomizeChromePageHandlerProxy::OpenNtpManagedByPage(
) { … }
void CustomizeChromePageHandlerProxy::SetModulesVisible(
bool in_visible) { … }
void CustomizeChromePageHandlerProxy::SetModuleDisabled(
const std::string& in_module_id, bool in_disabled) { … }
void CustomizeChromePageHandlerProxy::UpdateScrollToSection(
) { … }
void CustomizeChromePageHandlerProxy::UpdateAttachedTabState(
) { … }
void CustomizeChromePageHandlerProxy::UpdateNtpManagedByName(
) { … }
class CustomizeChromePageHandler_GetBackgroundCollections_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool CustomizeChromePageHandler_GetBackgroundCollections_ForwardToCallback::Accept(
mojo::Message* message) { … }
void CustomizeChromePageHandler_GetBackgroundCollections_ProxyToResponder::Run(
std::vector<BackgroundCollectionPtr> in_collections) { … }
class CustomizeChromePageHandler_GetBackgroundImages_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool CustomizeChromePageHandler_GetBackgroundImages_ForwardToCallback::Accept(
mojo::Message* message) { … }
void CustomizeChromePageHandler_GetBackgroundImages_ProxyToResponder::Run(
std::vector<CollectionImagePtr> in_images) { … }
class CustomizeChromePageHandler_ChooseLocalCustomBackground_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool CustomizeChromePageHandler_ChooseLocalCustomBackground_ForwardToCallback::Accept(
mojo::Message* message) { … }
void CustomizeChromePageHandler_ChooseLocalCustomBackground_ProxyToResponder::Run(
bool in_success) { … }
bool CustomizeChromePageHandlerStubDispatch::Accept(
CustomizeChromePageHandler* impl,
mojo::Message* message) { … }
bool CustomizeChromePageHandlerStubDispatch::AcceptWithResponder(
CustomizeChromePageHandler* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kCustomizeChromePageHandlerValidationInfo[] = …;
bool CustomizeChromePageHandlerRequestValidator::Accept(mojo::Message* message) { … }
bool CustomizeChromePageHandlerResponseValidator::Accept(mojo::Message* message) { … }
const char CustomizeChromePage::Name_[] = …;
CustomizeChromePage::IPCStableHashFunction CustomizeChromePage::MessageToMethodInfo_(mojo::Message& message) { … }
const char* CustomizeChromePage::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t CustomizeChromePage::SetModulesSettings_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePage::SetMostVisitedSettings_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePage::SetTheme_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePage::ScrollToSection_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePage::AttachedTabStateUpdated_Sym::IPCStableHash() { … }
uint32_t CustomizeChromePage::NtpManagedByNameUpdated_Sym::IPCStableHash() { … }
# endif
CustomizeChromePageProxy::CustomizeChromePageProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void CustomizeChromePageProxy::SetModulesSettings(
std::vector<ModuleSettingsPtr> in_modules_settings, bool in_managed, bool in_visible) { … }
void CustomizeChromePageProxy::SetMostVisitedSettings(
bool in_custom_links_enabled, bool in_visible) { … }
void CustomizeChromePageProxy::SetTheme(
ThemePtr in_theme) { … }
void CustomizeChromePageProxy::ScrollToSection(
CustomizeChromeSection in_section) { … }
void CustomizeChromePageProxy::AttachedTabStateUpdated(
bool in_is_source_tab_first_party_ntp) { … }
void CustomizeChromePageProxy::NtpManagedByNameUpdated(
const std::string& in_ntp_managed_by_name) { … }
bool CustomizeChromePageStubDispatch::Accept(
CustomizeChromePage* impl,
mojo::Message* message) { … }
bool CustomizeChromePageStubDispatch::AcceptWithResponder(
CustomizeChromePage* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kCustomizeChromePageValidationInfo[] = …;
bool CustomizeChromePageRequestValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::side_panel::mojom::BackgroundImage::DataView, ::side_panel::mojom::BackgroundImagePtr>::Read(
::side_panel::mojom::BackgroundImage::DataView input,
::side_panel::mojom::BackgroundImagePtr* output) { … }
bool StructTraits<::side_panel::mojom::ThirdPartyThemeInfo::DataView, ::side_panel::mojom::ThirdPartyThemeInfoPtr>::Read(
::side_panel::mojom::ThirdPartyThemeInfo::DataView input,
::side_panel::mojom::ThirdPartyThemeInfoPtr* output) { … }
bool StructTraits<::side_panel::mojom::Theme::DataView, ::side_panel::mojom::ThemePtr>::Read(
::side_panel::mojom::Theme::DataView input,
::side_panel::mojom::ThemePtr* output) { … }
bool StructTraits<::side_panel::mojom::BackgroundCollection::DataView, ::side_panel::mojom::BackgroundCollectionPtr>::Read(
::side_panel::mojom::BackgroundCollection::DataView input,
::side_panel::mojom::BackgroundCollectionPtr* output) { … }
bool StructTraits<::side_panel::mojom::CollectionImage::DataView, ::side_panel::mojom::CollectionImagePtr>::Read(
::side_panel::mojom::CollectionImage::DataView input,
::side_panel::mojom::CollectionImagePtr* output) { … }
bool StructTraits<::side_panel::mojom::ModuleSettings::DataView, ::side_panel::mojom::ModuleSettingsPtr>::Read(
::side_panel::mojom::ModuleSettings::DataView input,
::side_panel::mojom::ModuleSettingsPtr* output) { … }
}
namespace side_panel::mojom {
void CustomizeChromePageHandlerFactoryInterceptorForTesting::CreatePageHandler(::mojo::PendingRemote<CustomizeChromePage> page, ::mojo::PendingReceiver<CustomizeChromePageHandler> handler) { … }
CustomizeChromePageHandlerFactoryAsyncWaiter::CustomizeChromePageHandlerFactoryAsyncWaiter(
CustomizeChromePageHandlerFactory* proxy) : … { … }
CustomizeChromePageHandlerFactoryAsyncWaiter::~CustomizeChromePageHandlerFactoryAsyncWaiter() = default;
void CustomizeChromePageHandlerInterceptorForTesting::SetMostVisitedSettings(bool custom_links_enabled, bool shortcuts_visible) { … }
void CustomizeChromePageHandlerInterceptorForTesting::UpdateMostVisitedSettings() { … }
void CustomizeChromePageHandlerInterceptorForTesting::GetBackgroundCollections(GetBackgroundCollectionsCallback callback) { … }
void CustomizeChromePageHandlerInterceptorForTesting::GetBackgroundImages(const std::string& collection_id, GetBackgroundImagesCallback callback) { … }
void CustomizeChromePageHandlerInterceptorForTesting::UpdateModulesSettings() { … }
void CustomizeChromePageHandlerInterceptorForTesting::UpdateTheme() { … }
void CustomizeChromePageHandlerInterceptorForTesting::SetDefaultColor() { … }
void CustomizeChromePageHandlerInterceptorForTesting::SetFollowDeviceTheme(bool follow) { … }
void CustomizeChromePageHandlerInterceptorForTesting::RemoveBackgroundImage() { … }
void CustomizeChromePageHandlerInterceptorForTesting::ChooseLocalCustomBackground(ChooseLocalCustomBackgroundCallback callback) { … }
void CustomizeChromePageHandlerInterceptorForTesting::SetBackgroundImage(const std::string& attribution_1, const std::string& attribution_2, const ::GURL& attribution_url, const ::GURL& image_url, const ::GURL& thumbnail_url, const std::string& collection_id) { … }
void CustomizeChromePageHandlerInterceptorForTesting::SetDailyRefreshCollectionId(const std::string& collection_id) { … }
void CustomizeChromePageHandlerInterceptorForTesting::OpenChromeWebStore() { … }
void CustomizeChromePageHandlerInterceptorForTesting::OpenChromeWebStoreHomePage() { … }
void CustomizeChromePageHandlerInterceptorForTesting::OpenThirdPartyThemePage(const std::string& theme_id) { … }
void CustomizeChromePageHandlerInterceptorForTesting::OpenChromeWebStoreCategoryPage(ChromeWebStoreCategory category) { … }
void CustomizeChromePageHandlerInterceptorForTesting::OpenChromeWebStoreCollectionPage(ChromeWebStoreCollection collection) { … }
void CustomizeChromePageHandlerInterceptorForTesting::OpenNtpManagedByPage() { … }
void CustomizeChromePageHandlerInterceptorForTesting::SetModulesVisible(bool visible) { … }
void CustomizeChromePageHandlerInterceptorForTesting::SetModuleDisabled(const std::string& module_id, bool disabled) { … }
void CustomizeChromePageHandlerInterceptorForTesting::UpdateScrollToSection() { … }
void CustomizeChromePageHandlerInterceptorForTesting::UpdateAttachedTabState() { … }
void CustomizeChromePageHandlerInterceptorForTesting::UpdateNtpManagedByName() { … }
CustomizeChromePageHandlerAsyncWaiter::CustomizeChromePageHandlerAsyncWaiter(
CustomizeChromePageHandler* proxy) : … { … }
CustomizeChromePageHandlerAsyncWaiter::~CustomizeChromePageHandlerAsyncWaiter() = default;
void CustomizeChromePageHandlerAsyncWaiter::GetBackgroundCollections(
std::vector<BackgroundCollectionPtr>* out_collections) { … }
std::vector<BackgroundCollectionPtr> CustomizeChromePageHandlerAsyncWaiter::GetBackgroundCollections(
) { … }
void CustomizeChromePageHandlerAsyncWaiter::GetBackgroundImages(
const std::string& collection_id, std::vector<CollectionImagePtr>* out_images) { … }
std::vector<CollectionImagePtr> CustomizeChromePageHandlerAsyncWaiter::GetBackgroundImages(
const std::string& collection_id) { … }
void CustomizeChromePageHandlerAsyncWaiter::ChooseLocalCustomBackground(
bool* out_success) { … }
bool CustomizeChromePageHandlerAsyncWaiter::ChooseLocalCustomBackground(
) { … }
void CustomizeChromePageInterceptorForTesting::SetModulesSettings(std::vector<ModuleSettingsPtr> modules_settings, bool managed, bool visible) { … }
void CustomizeChromePageInterceptorForTesting::SetMostVisitedSettings(bool custom_links_enabled, bool visible) { … }
void CustomizeChromePageInterceptorForTesting::SetTheme(ThemePtr theme) { … }
void CustomizeChromePageInterceptorForTesting::ScrollToSection(CustomizeChromeSection section) { … }
void CustomizeChromePageInterceptorForTesting::AttachedTabStateUpdated(bool is_source_tab_first_party_ntp) { … }
void CustomizeChromePageInterceptorForTesting::NtpManagedByNameUpdated(const std::string& ntp_managed_by_name) { … }
CustomizeChromePageAsyncWaiter::CustomizeChromePageAsyncWaiter(
CustomizeChromePage* proxy) : … { … }
CustomizeChromePageAsyncWaiter::~CustomizeChromePageAsyncWaiter() = default;
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif