Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: chrome/browser/android/browsing_data/browsing_data_counter_bridge.cc

Issue 2084903002: Moved BrowsingDataCounter and part of BrowsingDataCounterUtils to components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698