| Index: chrome/browser/android/browsing_data/browsing_data_counter_bridge.cc
|
| diff --git a/chrome/browser/android/browsing_data/browsing_data_counter_bridge.cc b/chrome/browser/android/browsing_data/browsing_data_counter_bridge.cc
|
| index 0cbb30bd466478aa99037b44d24043dbfcc3e399..3af31e0dc04f4f1d4712fc155ad2252867e89e91 100644
|
| --- a/chrome/browser/android/browsing_data/browsing_data_counter_bridge.cc
|
| +++ b/chrome/browser/android/browsing_data/browsing_data_counter_bridge.cc
|
| @@ -6,31 +6,34 @@
|
|
|
| #include "base/android/jni_string.h"
|
| #include "chrome/browser/browsing_data/browsing_data_counter_utils.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/common/pref_names.h"
|
| +#include "components/browsing_data/browsing_data_utils.h"
|
| #include "jni/BrowsingDataCounterBridge_jni.h"
|
|
|
| BrowsingDataCounterBridge::BrowsingDataCounterBridge(
|
| JNIEnv* env, const JavaParamRef<jobject>& obj, jint data_type)
|
| : jobject_(obj) {
|
| DCHECK_GE(data_type, 0);
|
| - DCHECK_LT(data_type, BrowsingDataType::NUM_TYPES);
|
| + DCHECK_LT(data_type, browsing_data::NUM_TYPES);
|
|
|
| std::string pref;
|
| if (!GetDeletionPreferenceFromDataType(
|
| - static_cast<BrowsingDataType>(data_type), &pref)) {
|
| + static_cast<browsing_data::BrowsingDataType>(data_type), &pref)) {
|
| return;
|
| }
|
|
|
| - counter_.reset(CreateCounterForPreference(pref));
|
| + Profile* profile =
|
| + ProfileManager::GetActiveUserProfile()->GetOriginalProfile();
|
| + counter_.reset(CreateCounterForPreference(pref, profile));
|
|
|
| if (!counter_)
|
| return;
|
|
|
| - counter_->Init(
|
| - ProfileManager::GetActiveUserProfile()->GetOriginalProfile(),
|
| - base::Bind(&BrowsingDataCounterBridge::onCounterFinished,
|
| - base::Unretained(this)));
|
| + counter_->Init(profile->GetPrefs(),
|
| + base::Bind(&BrowsingDataCounterBridge::onCounterFinished,
|
| + base::Unretained(this)));
|
| counter_->Restart();
|
| }
|
|
|
| @@ -48,7 +51,7 @@ bool BrowsingDataCounterBridge::Register(JNIEnv* env) {
|
| }
|
|
|
| void BrowsingDataCounterBridge::onCounterFinished(
|
| - std::unique_ptr<BrowsingDataCounter::Result> result) {
|
| + std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result) {
|
| JNIEnv* env = base::android::AttachCurrentThread();
|
| ScopedJavaLocalRef<jstring> result_string =
|
| base::android::ConvertUTF16ToJavaString(
|
|
|