#ifndef CHROME_BROWSER_ANDROID_BROWSING_DATA_BROWSING_DATA_COUNTER_BRIDGE_H_
#define CHROME_BROWSER_ANDROID_BROWSING_DATA_BROWSING_DATA_COUNTER_BRIDGE_H_
#include "base/android/jni_weak_ref.h"
#include "base/android/scoped_java_ref.h"
#include "base/memory/raw_ptr.h"
#include "components/browsing_data/core/browsing_data_utils.h"
#include "components/browsing_data/core/counters/browsing_data_counter.h"
class Profile;
class BrowsingDataCounterBridge {
public:
BrowsingDataCounterBridge(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
Profile* profile,
jint selected_time_period,
jint data_type);
BrowsingDataCounterBridge(const BrowsingDataCounterBridge&) = delete;
BrowsingDataCounterBridge& operator=(const BrowsingDataCounterBridge&) =
delete;
~BrowsingDataCounterBridge();
void SetSelectedTimePeriod(JNIEnv* env,
jint selected_time_period);
void Destroy(JNIEnv* env);
private:
void onCounterFinished(
std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result);
base::android::ScopedJavaGlobalRef<jobject> jobject_;
raw_ptr<Profile> profile_;
std::unique_ptr<browsing_data::BrowsingDataCounter> counter_;
};
#endif