#include "chrome/browser/ui/webui/cr_components/history_embeddings/history_embeddings_handler.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/feedback/show_feedback_page.h"
#include "chrome/browser/history_embeddings/history_embeddings_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "components/history_embeddings/history_embeddings_features.h"
#include "components/history_embeddings/history_embeddings_service.h"
#include "components/strings/grit/components_strings.h"
#include "components/url_formatter/url_formatter.h"
#include "history_embeddings_handler.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/time_format.h"
#include "url/gurl.h"
namespace {
optimization_guide::proto::UserFeedback
OptimizationFeedbackFromMojoUserFeedback(
history_embeddings::mojom::UserFeedback feedback) { … }
}
HistoryEmbeddingsHandler::HistoryEmbeddingsHandler(
mojo::PendingReceiver<history_embeddings::mojom::PageHandler>
pending_page_handler,
base::WeakPtr<Profile> profile,
content::WebUI* web_ui)
: … { … }
HistoryEmbeddingsHandler::~HistoryEmbeddingsHandler() = default;
void HistoryEmbeddingsHandler::SetPage(
mojo::PendingRemote<history_embeddings::mojom::Page> pending_page) { … }
void HistoryEmbeddingsHandler::Search(
history_embeddings::mojom::SearchQueryPtr query) { … }
void HistoryEmbeddingsHandler::OnReceivedSearchResult(
history_embeddings::SearchResult native_search_result) { … }
void HistoryEmbeddingsHandler::SendQualityLog(
const std::vector<uint32_t>& selected_indices,
uint32_t num_chars_for_query) { … }
void HistoryEmbeddingsHandler::RecordSearchResultsMetrics(
bool non_empty_results,
bool user_clicked_results) { … }
void HistoryEmbeddingsHandler::SetUserFeedback(
history_embeddings::mojom::UserFeedback user_feedback) { … }
void HistoryEmbeddingsHandler::MaybeShowFeaturePromo() { … }