#include "components/power_bookmarks/core/power_bookmark_utils.h"
#include <string>
#include <vector>
#include "base/base64.h"
#include "base/i18n/string_search.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/power_bookmarks/core/proto/power_bookmark_meta.pb.h"
#include "ui/base/models/tree_node_iterator.h"
#include "url/gurl.h"
namespace power_bookmarks {
namespace {
void BackfillShoppingSpecifics(PowerBookmarkMeta* meta) { … }
}
const char kPowerBookmarkMetaKey[] = …;
PowerBookmarkQueryFields::PowerBookmarkQueryFields() = default;
PowerBookmarkQueryFields::~PowerBookmarkQueryFields() = default;
std::unique_ptr<PowerBookmarkMeta> GetNodePowerBookmarkMeta(
bookmarks::BookmarkModel* model,
const bookmarks::BookmarkNode* node) { … }
void SetNodePowerBookmarkMeta(bookmarks::BookmarkModel* model,
const bookmarks::BookmarkNode* node,
std::unique_ptr<PowerBookmarkMeta> meta) { … }
void DeleteNodePowerBookmarkMeta(bookmarks::BookmarkModel* model,
const bookmarks::BookmarkNode* node) { … }
bool DoBookmarkTagsContainWords(const std::unique_ptr<PowerBookmarkMeta>& meta,
const std::vector<std::u16string>& words) { … }
template <class type>
std::vector<const bookmarks::BookmarkNode*> GetBookmarksMatchingPropertiesImpl(
type& iterator,
bookmarks::BookmarkModel* model,
const PowerBookmarkQueryFields& query,
const std::vector<std::u16string>& query_words,
size_t max_count) { … }
std::vector<const bookmarks::BookmarkNode*> GetBookmarksMatchingProperties(
bookmarks::BookmarkModel* model,
const PowerBookmarkQueryFields& query,
size_t max_count) { … }
void EncodeMetaForStorage(const PowerBookmarkMeta& meta, std::string* out) { … }
bool DecodeMetaFromStorage(const std::string& data, PowerBookmarkMeta* out) { … }
}