#include "components/user_notes/browser/user_note_service.h"
#include "base/functional/bind.h"
#include "base/not_fatal_until.h"
#include "base/notreached.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/typed_macros.h"
#include "components/user_notes/browser/frame_user_note_changes.h"
#include "components/user_notes/browser/user_note_manager.h"
#include "components/user_notes/browser/user_note_utils.h"
#include "components/user_notes/interfaces/user_note_metadata_snapshot.h"
#include "components/user_notes/interfaces/user_notes_ui.h"
#include "components/user_notes/user_notes_features.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/weak_document_ptr.h"
#include "ui/gfx/geometry/rect.h"
namespace user_notes {
UserNoteService::UserNoteService(
std::unique_ptr<UserNoteServiceDelegate> delegate,
std::unique_ptr<UserNoteStorage> storage)
: … { … }
UserNoteService::~UserNoteService() = default;
base::SafeRef<UserNoteService> UserNoteService::GetSafeRef() const { … }
const UserNote* UserNoteService::GetNoteModel(
const base::UnguessableToken& id) const { … }
bool UserNoteService::IsNoteInProgress(const base::UnguessableToken& id) const { … }
void UserNoteService::OnFrameNavigated(content::RenderFrameHost* rfh) { … }
void UserNoteService::OnNoteInstanceAddedToPage(
const base::UnguessableToken& id,
UserNoteManager* manager) { … }
void UserNoteService::OnNoteInstanceRemovedFromPage(
const base::UnguessableToken& id,
UserNoteManager* manager) { … }
void UserNoteService::OnAddNoteRequested(content::RenderFrameHost* frame,
bool has_selected_text) { … }
void UserNoteService::OnWebHighlightFocused(const base::UnguessableToken& id,
content::RenderFrameHost* rfh) { … }
void UserNoteService::OnNoteSelected(const base::UnguessableToken& id,
content::RenderFrameHost* rfh) { … }
void UserNoteService::OnNoteDeleted(const base::UnguessableToken& id) { … }
void UserNoteService::OnNoteCreationDone(const base::UnguessableToken& id,
const std::u16string& note_content) { … }
void UserNoteService::OnNoteCreationCancelled(
const base::UnguessableToken& id) { … }
void UserNoteService::OnNoteEdited(const base::UnguessableToken& id,
const std::u16string& note_content) { … }
void UserNoteService::OnNotesChanged() { … }
void UserNoteService::InitializeNewNoteForCreation(
content::WeakDocumentPtr document,
bool is_page_level,
mojo::PendingReceiver<blink::mojom::AnnotationAgentHost> host_receiver,
mojo::PendingRemote<blink::mojom::AnnotationAgent> agent_remote,
const std::string& serialized_selector,
const std::u16string& selected_text) { … }
void UserNoteService::OnNoteMetadataFetchedForNavigation(
const std::vector<content::WeakDocumentPtr>& all_frames,
UserNoteMetadataSnapshot metadata_snapshot) { … }
void UserNoteService::OnNoteMetadataFetched(
const std::vector<content::WeakDocumentPtr>& all_frames,
UserNoteMetadataSnapshot metadata_snapshot) { … }
void UserNoteService::OnNoteModelsFetched(
const IdSet& new_notes,
std::vector<std::unique_ptr<FrameUserNoteChanges>> note_changes,
std::vector<std::unique_ptr<UserNote>> notes) { … }
void UserNoteService::OnFrameChangesApplied(base::UnguessableToken change_id) { … }
UserNoteService::ModelMapEntry::ModelMapEntry(std::unique_ptr<UserNote> model)
: … { … }
UserNoteService::ModelMapEntry::ModelMapEntry(ModelMapEntry&& other) = default;
UserNoteService::ModelMapEntry::~ModelMapEntry() = default;
}