#include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h"
#include <stddef.h>
#include <limits>
#include <memory>
#include <string>
#include <utility>
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/lazy_instance.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
#include "chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.h"
#include "chrome/browser/extensions/bookmarks/bookmarks_error_constants.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/common/extensions/api/bookmarks.h"
#include "chrome/common/importer/importer_data_types.h"
#include "chrome/common/pref_names.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/bookmarks/common/bookmark_metrics.h"
#include "components/bookmarks/managed/managed_bookmark_service.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_function_dispatcher.h"
BookmarkModel;
BookmarkNode;
ManagedBookmarkService;
namespace extensions {
BookmarkTreeNode;
CreateDetails;
BrowserContext;
BrowserThread;
WebContents;
BookmarkEventRouter::BookmarkEventRouter(Profile* profile)
: … { … }
BookmarkEventRouter::~BookmarkEventRouter() { … }
void BookmarkEventRouter::DispatchEvent(events::HistogramValue histogram_value,
const std::string& event_name,
base::Value::List event_args) { … }
void BookmarkEventRouter::BookmarkModelLoaded(bool ids_reassigned) { … }
void BookmarkEventRouter::BookmarkModelBeingDeleted() { … }
void BookmarkEventRouter::BookmarkNodeMoved(const BookmarkNode* old_parent,
size_t old_index,
const BookmarkNode* new_parent,
size_t new_index) { … }
void BookmarkEventRouter::BookmarkNodeAdded(const BookmarkNode* parent,
size_t index,
bool added_by_user) { … }
void BookmarkEventRouter::BookmarkNodeRemoved(
const BookmarkNode* parent,
size_t index,
const BookmarkNode* node,
const std::set<GURL>& removed_urls,
const base::Location& location) { … }
void BookmarkEventRouter::BookmarkAllUserNodesRemoved(
const std::set<GURL>& removed_urls,
const base::Location& location) { … }
void BookmarkEventRouter::BookmarkNodeChanged(const BookmarkNode* node) { … }
void BookmarkEventRouter::BookmarkNodeFaviconChanged(const BookmarkNode* node) { … }
void BookmarkEventRouter::BookmarkNodeChildrenReordered(
const BookmarkNode* node) { … }
void BookmarkEventRouter::ExtensiveBookmarkChangesBeginning() { … }
void BookmarkEventRouter::ExtensiveBookmarkChangesEnded() { … }
BookmarksAPI::BookmarksAPI(BrowserContext* context)
: … { … }
BookmarksAPI::~BookmarksAPI() { … }
void BookmarksAPI::Shutdown() { … }
static base::LazyInstance<BrowserContextKeyedAPIFactory<BookmarksAPI>>::
DestructorAtExit g_bookmarks_api_factory = …;
BrowserContextKeyedAPIFactory<BookmarksAPI>*
BookmarksAPI::GetFactoryInstance() { … }
void BookmarksAPI::OnListenerAdded(const EventListenerInfo& details) { … }
ExtensionFunction::ResponseValue BookmarksGetFunction::RunOnReady() { … }
ExtensionFunction::ResponseValue BookmarksGetChildrenFunction::RunOnReady() { … }
ExtensionFunction::ResponseValue BookmarksGetRecentFunction::RunOnReady() { … }
ExtensionFunction::ResponseValue BookmarksGetTreeFunction::RunOnReady() { … }
ExtensionFunction::ResponseValue BookmarksGetSubTreeFunction::RunOnReady() { … }
ExtensionFunction::ResponseValue BookmarksSearchFunction::RunOnReady() { … }
ExtensionFunction::ResponseValue BookmarksRemoveFunctionBase::RunOnReady() { … }
bool BookmarksRemoveFunction::is_recursive() const { … }
bool BookmarksRemoveTreeFunction::is_recursive() const { … }
ExtensionFunction::ResponseValue BookmarksCreateFunction::RunOnReady() { … }
const BookmarkNode* BookmarksCreateFunction::CreateBookmarkNode(
BookmarkModel* model,
const CreateDetails& details,
std::string* error) { … }
ExtensionFunction::ResponseValue BookmarksMoveFunction::RunOnReady() { … }
ExtensionFunction::ResponseValue BookmarksUpdateFunction::RunOnReady() { … }
}