#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.h"
#include <string>
#include <utility>
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/commerce/shopping_service_factory.h"
#include "chrome/browser/feature_engagement/tracker_factory.h"
#include "chrome/browser/page_image_service/image_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/webui/bookmarks/bookmark_prefs.h"
#include "chrome/browser/ui/webui/commerce/shopping_list_context_menu_controller.h"
#include "chrome/browser/ui/webui/favicon_source.h"
#include "chrome/browser/ui/webui/plural_string_handler.h"
#include "chrome/browser/ui/webui/sanitized_image_source.h"
#include "chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_page_handler.h"
#include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/side_panel_bookmarks_resources.h"
#include "chrome/grit/side_panel_bookmarks_resources_map.h"
#include "chrome/grit/side_panel_shared_resources.h"
#include "chrome/grit/side_panel_shared_resources_map.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/bookmarks/managed/managed_bookmark_service.h"
#include "components/commerce/core/commerce_feature_list.h"
#include "components/commerce/core/shopping_service.h"
#include "components/commerce/core/webui/shopping_service_handler.h"
#include "components/favicon_base/favicon_url_parser.h"
#include "components/page_image_service/features.h"
#include "components/page_image_service/image_service.h"
#include "components/page_image_service/image_service_handler.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/webui/web_ui_util.h"
#include "ui/views/style/platform_style.h"
#include "ui/webui/color_change_listener/color_change_handler.h"
BookmarksSidePanelUIConfig::BookmarksSidePanelUIConfig()
: … { … }
bool BookmarksSidePanelUIConfig::IsPreloadable() { … }
std::optional<int> BookmarksSidePanelUIConfig::GetCommandIdForTesting() { … }
BookmarksSidePanelUI::BookmarksSidePanelUI(content::WebUI* web_ui)
: … { … }
BookmarksSidePanelUI::~BookmarksSidePanelUI() = default;
WEB_UI_CONTROLLER_TYPE_IMPL(BookmarksSidePanelUI)
void BookmarksSidePanelUI::BindInterface(
mojo::PendingReceiver<side_panel::mojom::BookmarksPageHandlerFactory>
receiver) { … }
void BookmarksSidePanelUI::BindInterface(
mojo::PendingReceiver<
shopping_service::mojom::ShoppingServiceHandlerFactory> receiver) { … }
void BookmarksSidePanelUI::BindInterface(
mojo::PendingReceiver<color_change_listener::mojom::PageHandler>
pending_receiver) { … }
void BookmarksSidePanelUI::BindInterface(
mojo::PendingReceiver<page_image_service::mojom::PageImageServiceHandler>
pending_image_handler) { … }
commerce::ShoppingListContextMenuController*
BookmarksSidePanelUI::GetShoppingListContextMenuController() { … }
void BookmarksSidePanelUI::CreateBookmarksPageHandler(
mojo::PendingReceiver<side_panel::mojom::BookmarksPageHandler> receiver) { … }
void BookmarksSidePanelUI::CreateShoppingServiceHandler(
mojo::PendingRemote<shopping_service::mojom::Page> page,
mojo::PendingReceiver<shopping_service::mojom::ShoppingServiceHandler>
receiver) { … }
bool BookmarksSidePanelUI::IsIncognitoModeAvailable() { … }