Commit ee0d8869 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

🚫Bind: components/search_provider_logos/

Migrates some directories off of deprecated base::Bind, base::Callback,
etc, and onto the newer APIs.

Specifically this covers files in components/search_provider_logos/

Fixed: 1007728
Change-Id: Icc664ea3b2fdfc690d0cfe32a879b4d8c071707e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972240Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#726010}
parent d75382a0
......@@ -199,7 +199,7 @@ struct LogoCallbacks {
// Parses the response from the server and returns it as an EncodedLogo. Returns
// null if the response is invalid.
using ParseLogoResponse = base::Callback<std::unique_ptr<EncodedLogo>(
using ParseLogoResponse = base::RepeatingCallback<std::unique_ptr<EncodedLogo>(
std::unique_ptr<std::string> response,
base::Time response_time,
bool* parsing_failed)>;
......@@ -207,7 +207,8 @@ using ParseLogoResponse = base::Callback<std::unique_ptr<EncodedLogo>(
// Encodes the fingerprint of the cached logo in the logo URL. This enables the
// server to verify whether the cached logo is up to date.
using AppendQueryparamsToLogoURL =
base::Callback<GURL(const GURL& logo_url, const std::string& fingerprint)>;
base::RepeatingCallback<GURL(const GURL& logo_url,
const std::string& fingerprint)>;
} // namespace search_provider_logos
......
......@@ -17,8 +17,8 @@ class LogoObserver;
// Example usage:
// LogoService* logo_service = LogoServiceFactory::GetForProfile(profile);
// LogoCallbacks callbacks;
// callbacks.on_cached_decoded_logo = base::Bind(ShowLogo);
// callbacks.on_fresh_decoded_logo = base::Bind(FadeToLogo);
// callbacks.on_cached_decoded_logo = base::BindOnce(ShowLogo);
// callbacks.on_fresh_decoded_logo = base::BindOnce(FadeToLogo);
// logo_service->GetLogo(callbacks);
//
class LogoService : public KeyedService {
......
......@@ -288,8 +288,10 @@ void LogoServiceImpl::GetLogo(LogoCallbacks callbacks) {
want_gray_logo_getter_.Run(), doodle_url);
SetServerAPI(
prefilled_url,
base::Bind(&search_provider_logos::ParseDoodleLogoResponse, base_url),
base::Bind(&search_provider_logos::AppendFingerprintParamToDoodleURL));
base::BindRepeating(&search_provider_logos::ParseDoodleLogoResponse,
base_url),
base::BindRepeating(
&search_provider_logos::AppendFingerprintParamToDoodleURL));
}
DCHECK(!logo_url_.is_empty());
......
......@@ -847,7 +847,7 @@ TEST_F(LogoServiceImplTest, LogoWithTTLCannotBeShownAfterExpiration) {
logo.metadata.expiration_time = test_clock_.Now() + time_to_live;
SetServerResponse(ServerResponse(logo));
LogoCallbacks callbacks;
callbacks.on_fresh_decoded_logo_available = base::Bind(
callbacks.on_fresh_decoded_logo_available = base::BindOnce(
[](LogoCallbackReason type, const base::Optional<Logo>& logo) {});
GetLogo(std::move(callbacks));
......@@ -862,7 +862,7 @@ TEST_F(LogoServiceImplTest, LogoWithoutTTLCanBeShownAfterExpiration) {
base::TimeDelta time_to_live = base::TimeDelta();
SetServerResponse(MakeServerResponse(logo, time_to_live));
LogoCallbacks callbacks;
callbacks.on_fresh_decoded_logo_available = base::Bind(
callbacks.on_fresh_decoded_logo_available = base::BindOnce(
[](LogoCallbackReason type, const base::Optional<Logo>& logo) {});
GetLogo(std::move(callbacks));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment