#include "chrome/browser/companion/core/companion_url_builder.h"
#include "base/base64url.h"
#include "base/feature_list.h"
#include "base/time/time.h"
#include "chrome/browser/companion/core/companion_permission_utils.h"
#include "chrome/browser/companion/core/constants.h"
#include "chrome/browser/companion/core/features.h"
#include "chrome/browser/companion/core/proto/companion_url_params.pb.h"
#include "chrome/browser/companion/core/signin_delegate.h"
#include "chrome/browser/companion/core/utils.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "net/base/url_util.h"
#include "url/gurl.h"
#if (!BUILDFLAG(IS_ANDROID))
#include "chrome/common/companion/visual_query/features.h"
#endif
namespace companion {
namespace {
inline constexpr char kCompanionRequestQueryParameterKey[] = …;
inline constexpr char kUrlQueryParameterKey[] = …;
inline constexpr char kOriginQueryParameterKey[] = …;
inline constexpr char kTextQueryParameterKey[] = …;
inline constexpr char kOriginQueryParameterValue[] = …;
}
CompanionUrlBuilder::CompanionUrlBuilder(PrefService* pref_service,
SigninDelegate* signin_delegate)
: … { … }
CompanionUrlBuilder::~CompanionUrlBuilder() = default;
GURL CompanionUrlBuilder::BuildCompanionURL(const GURL& page_url) { … }
GURL CompanionUrlBuilder::BuildCompanionURL(
const GURL& page_url,
const std::string& text_query,
std::unique_ptr<base::Time> text_query_start_time) { … }
GURL CompanionUrlBuilder::AppendCompanionParamsToURL(
const GURL& base_url,
const GURL& page_url,
const std::string& text_query,
std::unique_ptr<base::Time> text_query_start_time) { … }
std::string CompanionUrlBuilder::BuildCompanionUrlParamProto(
const GURL& page_url,
std::unique_ptr<base::Time> text_query_start_time) { … }
}