0

Remove unused methods from public AmbientBackendController API.

This is clean-up, but makes the changes required for the immediate
bug easier.

Bug: b:275561700
Change-Id: I2c40a5f5aa4949774ab620e6c0b2ad1de176f9fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4377335
Reviewed-by: Angela Xiao <angelaxiao@chromium.org>
Reviewed-by: Yuki Awano <yawano@google.com>
Commit-Queue: Eric Sum <esum@google.com>
Cr-Commit-Position: refs/heads/main@{#1123227}
This commit is contained in:
Eric Sum
2023-03-28 19:47:43 +00:00
committed by Chromium LUCI CQ
parent 17695fdfff
commit a76846e63c
4 changed files with 12 additions and 43 deletions

@ -35,14 +35,8 @@ class AmbientBackendControllerImpl : public AmbientBackendController {
OnScreenUpdateInfoFetchedCallback callback) override;
void FetchPreviewImages(const gfx::Size& preview_size,
OnPreviewImagesFetchedCallback callback) override;
void GetSettings(GetSettingsCallback callback) override;
void UpdateSettings(const AmbientSettings& settings,
UpdateSettingsCallback callback) override;
void FetchPersonalAlbums(int banner_width,
int banner_height,
int num_albums,
const std::string& resume_token,
OnPersonalAlbumsFetchedCallback callback) override;
void FetchSettingsAndAlbums(
int banner_width,
int banner_height,
@ -53,6 +47,11 @@ class AmbientBackendControllerImpl : public AmbientBackendController {
private:
using BackdropClientConfig = chromeos::ambient::BackdropClientConfig;
using GetSettingsCallback =
base::OnceCallback<void(const absl::optional<AmbientSettings>& settings)>;
using OnPersonalAlbumsFetchedCallback =
base::OnceCallback<void(PersonalAlbums)>;
void RequestAccessToken(AmbientClient::GetAccessTokenCallback callback);
void FetchScreenUpdateInfoInternal(int num_topics,
@ -67,6 +66,7 @@ class AmbientBackendControllerImpl : public AmbientBackendController {
std::unique_ptr<BackdropURLLoader> backdrop_url_loader,
std::unique_ptr<std::string> response);
void GetSettings(GetSettingsCallback callback);
void StartToGetSettings(GetSettingsCallback callback,
const std::string& gaia_id,
const std::string& access_token);
@ -85,6 +85,12 @@ class AmbientBackendControllerImpl : public AmbientBackendController {
std::unique_ptr<BackdropURLLoader> backdrop_url_loader,
std::unique_ptr<std::string> response);
void FetchPersonalAlbums(int banner_width,
int banner_height,
int num_albums,
const std::string& resume_token,
OnPersonalAlbumsFetchedCallback callback);
void FetchPersonalAlbumsInternal(int banner_width,
int banner_height,
int num_albums,

@ -96,11 +96,7 @@ class ASH_PUBLIC_EXPORT AmbientBackendController {
base::OnceCallback<void(const ScreenUpdate&)>;
using OnPreviewImagesFetchedCallback =
base::OnceCallback<void(const std::vector<GURL>& preview_urls)>;
using GetSettingsCallback =
base::OnceCallback<void(const absl::optional<AmbientSettings>& settings)>;
using UpdateSettingsCallback = base::OnceCallback<void(bool success)>;
using OnPersonalAlbumsFetchedCallback =
base::OnceCallback<void(PersonalAlbums)>;
// TODO(wutao): Make |settings| move only.
using OnSettingsAndAlbumsFetchedCallback =
base::OnceCallback<void(const absl::optional<AmbientSettings>& settings,
@ -134,19 +130,10 @@ class ASH_PUBLIC_EXPORT AmbientBackendController {
virtual void FetchPreviewImages(const gfx::Size& preview_size,
OnPreviewImagesFetchedCallback callback) = 0;
// Get ambient mode Settings from server.
virtual void GetSettings(GetSettingsCallback callback) = 0;
// Update ambient mode Settings to server.
virtual void UpdateSettings(const AmbientSettings& settings,
UpdateSettingsCallback callback) = 0;
virtual void FetchPersonalAlbums(int banner_width,
int banner_height,
int num_albums,
const std::string& resume_token,
OnPersonalAlbumsFetchedCallback) = 0;
// Fetch the Settings and albums as one API.
virtual void FetchSettingsAndAlbums(int banner_width,
int banner_height,

@ -138,13 +138,6 @@ void FakeAmbientBackendControllerImpl::FetchPreviewImages(
FROM_HERE, base::BindOnce(std::move(callback), urls));
}
void FakeAmbientBackendControllerImpl::GetSettings(
GetSettingsCallback callback) {
// Pretend to respond asynchronously.
base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), CreateFakeSettings()));
}
void FakeAmbientBackendControllerImpl::UpdateSettings(
const AmbientSettings& settings,
UpdateSettingsCallback callback) {
@ -153,17 +146,6 @@ void FakeAmbientBackendControllerImpl::UpdateSettings(
pending_update_callback_ = std::move(callback);
}
void FakeAmbientBackendControllerImpl::FetchPersonalAlbums(
int banner_width,
int banner_height,
int num_albums,
const std::string& resume_token,
OnPersonalAlbumsFetchedCallback callback) {
// Pretend to respond asynchronously.
base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), CreateFakeAlbums()));
}
void FakeAmbientBackendControllerImpl::FetchSettingsAndAlbums(
int banner_width,
int banner_height,

@ -33,14 +33,8 @@ class ASH_PUBLIC_EXPORT FakeAmbientBackendControllerImpl
OnScreenUpdateInfoFetchedCallback callback) override;
void FetchPreviewImages(const gfx::Size& preview_size,
OnPreviewImagesFetchedCallback callback) override;
void GetSettings(GetSettingsCallback callback) override;
void UpdateSettings(const AmbientSettings& settings,
UpdateSettingsCallback callback) override;
void FetchPersonalAlbums(int banner_width,
int banner_height,
int num_albums,
const std::string& resume_token,
OnPersonalAlbumsFetchedCallback callback) override;
void FetchSettingsAndAlbums(
int banner_width,
int banner_height,