#include "chrome/browser/bookmarks/chrome_bookmark_client.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
#include "base/notreached.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/commerce/shopping_service_factory.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/browser/bookmark_storage.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/bookmarks/managed/managed_bookmark_service.h"
#include "components/bookmarks/managed/managed_bookmark_util.h"
#include "components/commerce/core/commerce_feature_list.h"
#include "components/commerce/core/price_tracking_utils.h"
#include "components/commerce/core/shopping_service.h"
#include "components/favicon/core/favicon_util.h"
#include "components/favicon_base/favicon_types.h"
#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/url_database.h"
#include "components/offline_pages/buildflags/buildflags.h"
#include "components/power_bookmarks/core/suggested_save_location_provider.h"
#include "components/sync/base/features.h"
#include "components/sync_bookmarks/bookmark_model_view.h"
#include "components/sync_bookmarks/bookmark_sync_service.h"
#include "components/undo/bookmark_undo_service.h"
#if BUILDFLAG(ENABLE_OFFLINE_PAGES)
#include "chrome/browser/offline_pages/offline_page_bookmark_observer.h"
#endif
namespace {
class ShoppingCollectionProvider
: public power_bookmarks::SuggestedSaveLocationProvider { … };
}
ChromeBookmarkClient::ChromeBookmarkClient(
Profile* profile,
bookmarks::ManagedBookmarkService* managed_bookmark_service,
sync_bookmarks::BookmarkSyncService*
local_or_syncable_bookmark_sync_service,
sync_bookmarks::BookmarkSyncService* account_bookmark_sync_service,
BookmarkUndoService* bookmark_undo_service)
: … { … }
ChromeBookmarkClient::~ChromeBookmarkClient() { … }
void ChromeBookmarkClient::Init(bookmarks::BookmarkModel* model) { … }
base::CancelableTaskTracker::TaskId
ChromeBookmarkClient::GetFaviconImageForPageURL(
const GURL& page_url,
favicon_base::FaviconImageCallback callback,
base::CancelableTaskTracker* tracker) { … }
bool ChromeBookmarkClient::SupportsTypedCountForUrls() { … }
void ChromeBookmarkClient::GetTypedCountForUrls(
UrlTypedCountMap* url_typed_count_map) { … }
bookmarks::LoadManagedNodeCallback
ChromeBookmarkClient::GetLoadManagedNodeCallback() { … }
bool ChromeBookmarkClient::IsSyncFeatureEnabledIncludingBookmarks() { … }
bool ChromeBookmarkClient::CanSetPermanentNodeTitle(
const bookmarks::BookmarkNode* permanent_node) { … }
bool ChromeBookmarkClient::IsNodeManaged(const bookmarks::BookmarkNode* node) { … }
std::string ChromeBookmarkClient::EncodeLocalOrSyncableBookmarkSyncMetadata() { … }
std::string ChromeBookmarkClient::EncodeAccountBookmarkSyncMetadata() { … }
void ChromeBookmarkClient::DecodeLocalOrSyncableBookmarkSyncMetadata(
const std::string& metadata_str,
const base::RepeatingClosure& schedule_save_closure) { … }
void ChromeBookmarkClient::DecodeAccountBookmarkSyncMetadata(
const std::string& metadata_str,
const base::RepeatingClosure& schedule_save_closure) { … }
void ChromeBookmarkClient::OnBookmarkNodeRemovedUndoable(
const bookmarks::BookmarkNode* parent,
size_t index,
std::unique_ptr<bookmarks::BookmarkNode> node) { … }