#include "chrome/browser/ui/commerce/price_tracking_page_action_controller.h"
#include "base/check_is_test.h"
#include "base/metrics/histogram_functions.h"
#include "components/commerce/core/price_tracking_utils.h"
#include "components/commerce/core/shopping_service.h"
#include "components/feature_engagement/public/tracker.h"
#include "components/image_fetcher/core/image_fetcher.h"
namespace commerce {
namespace {
constexpr net::NetworkTrafficAnnotationTag kShoppingListTrafficAnnotation = …;
constexpr char kImageFetcherUmaClient[] = …;
constexpr int64_t kAlwaysExpandChipPriceMicros = …;
}
PriceTrackingPageActionController::PriceTrackingPageActionController(
base::RepeatingCallback<void()> notify_callback,
ShoppingService* shopping_service,
image_fetcher::ImageFetcher* image_fetcher,
feature_engagement::Tracker* tracker)
: … { … }
PriceTrackingPageActionController::~PriceTrackingPageActionController() { … }
std::optional<bool>
PriceTrackingPageActionController::ShouldShowForNavigation() { … }
bool PriceTrackingPageActionController::WantsExpandedUi() { … }
void PriceTrackingPageActionController::ResetForNewNavigation(const GURL& url) { … }
void PriceTrackingPageActionController::OnIconClicked() { … }
void PriceTrackingPageActionController::MaybeRecordPriceTrackingIconMetrics(
bool from_icon_use) { … }
void PriceTrackingPageActionController::HandleProductInfoResponse(
const GURL& url,
const std::optional<const ProductInfo>& info) { … }
void PriceTrackingPageActionController::MaybeDoProductImageFetch(
const std::optional<ProductInfo>& info) { … }
void PriceTrackingPageActionController::
UpdatePriceTrackingStateFromSubscriptions() { … }
void PriceTrackingPageActionController::OnSubscribe(
const CommerceSubscription& subscription,
bool succeeded) { … }
void PriceTrackingPageActionController::OnUnsubscribe(
const CommerceSubscription& subscription,
bool succeeded) { … }
void PriceTrackingPageActionController::HandleSubscriptionChange(
const CommerceSubscription& sub) { … }
void PriceTrackingPageActionController::HandleImageFetcherResponse(
const GURL image_url,
const gfx::Image& image,
const image_fetcher::RequestMetadata& request_metadata) { … }
const gfx::Image& PriceTrackingPageActionController::GetLastFetchedImage() { … }
const GURL& PriceTrackingPageActionController::GetLastFetchedImageUrl() { … }
bool PriceTrackingPageActionController::IsPriceTrackingCurrentProduct() { … }
void PriceTrackingPageActionController::SetImageFetcherForTesting(
image_fetcher::ImageFetcher* image_fetcher) { … }
}