#include "components/search_provider_logos/google_logo_api.h"
#include <stdint.h>
#include <algorithm>
#include <memory>
#include <string_view>
#include "base/base64.h"
#include "base/check.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_memory.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "components/google/core/common/google_util.h"
#include "components/search_provider_logos/switches.h"
#include "url/third_party/mozilla/url_parse.h"
#include "url/url_constants.h"
namespace search_provider_logos {
namespace {
const int kDefaultIframeWidthPx = …;
const int kDefaultIframeHeightPx = …;
}
GURL GetGoogleDoodleURL(const GURL& google_base_url) { … }
GURL AppendFingerprintParamToDoodleURL(const GURL& logo_url,
const std::string& fingerprint) { … }
GURL AppendPreliminaryParamsToDoodleURL(bool gray_background,
bool for_webui_ntp,
const GURL& logo_url) { … }
namespace {
const char kResponsePreamble[] = …;
GURL ParseUrl(const base::Value::Dict& parent_dict,
const std::string& key,
const GURL& base_url) { … }
std::pair<std::string, scoped_refptr<base::RefCountedString>>
ParseEncodedImageData(const std::string& encoded_image_data) { … }
}
std::unique_ptr<EncodedLogo> ParseDoodleLogoResponse(
const GURL& base_url,
std::unique_ptr<std::string> response,
base::Time response_time,
bool* parsing_failed) { … }
}