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

Side by Side Diff: chrome/browser/android/preferences/pref_service_bridge.cc

Issue 2131113003: [ImportantStorage] Blacklisted reason metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/preferences/pref_service_bridge.h" 5 #include "chrome/browser/android/preferences/pref_service_bridge.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 } 643 }
644 std::vector<std::string> excluding_domains; 644 std::vector<std::string> excluding_domains;
645 base::android::AppendJavaStringArrayToStringVector( 645 base::android::AppendJavaStringArrayToStringVector(
646 env, jexcluding_domains.obj(), &excluding_domains); 646 env, jexcluding_domains.obj(), &excluding_domains);
647 RegistrableDomainFilterBuilder filter_builder( 647 RegistrableDomainFilterBuilder filter_builder(
648 BrowsingDataFilterBuilder::BLACKLIST); 648 BrowsingDataFilterBuilder::BLACKLIST);
649 for (const std::string& domain : excluding_domains) { 649 for (const std::string& domain : excluding_domains) {
650 filter_builder.AddRegisterableDomain(domain); 650 filter_builder.AddRegisterableDomain(domain);
651 } 651 }
652 652
653 if (!excluding_domains.empty()) {
654 ImportantSitesUtil::RecordMetricsForBlacklistedSites(GetOriginalProfile(),
655 excluding_domains);
656 }
657
653 browsing_data_remover->RemoveWithFilter( 658 browsing_data_remover->RemoveWithFilter(
654 BrowsingDataRemover::Period( 659 BrowsingDataRemover::Period(
655 static_cast<BrowsingDataRemover::TimePeriod>(time_period)), 660 static_cast<BrowsingDataRemover::TimePeriod>(time_period)),
656 remove_mask, BrowsingDataHelper::UNPROTECTED_WEB, filter_builder); 661 remove_mask, BrowsingDataHelper::UNPROTECTED_WEB, filter_builder);
657 } 662 }
658 663
659 static jboolean CanDeleteBrowsingHistory(JNIEnv* env, 664 static jboolean CanDeleteBrowsingHistory(JNIEnv* env,
660 const JavaParamRef<jobject>& obj) { 665 const JavaParamRef<jobject>& obj) {
661 return GetPrefService()->GetBoolean(prefs::kAllowDeletingBrowserHistory); 666 return GetPrefService()->GetBoolean(prefs::kAllowDeletingBrowserHistory);
662 } 667 }
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 1191
1187 return ConvertJavaStringToUTF8(android_permission); 1192 return ConvertJavaStringToUTF8(android_permission);
1188 } 1193 }
1189 1194
1190 static void SetSupervisedUserId(JNIEnv* env, 1195 static void SetSupervisedUserId(JNIEnv* env,
1191 const JavaParamRef<jobject>& obj, 1196 const JavaParamRef<jobject>& obj,
1192 const JavaParamRef<jstring>& pref) { 1197 const JavaParamRef<jstring>& pref) {
1193 GetPrefService()->SetString(prefs::kSupervisedUserId, 1198 GetPrefService()->SetString(prefs::kSupervisedUserId,
1194 ConvertJavaStringToUTF8(env, pref)); 1199 ConvertJavaStringToUTF8(env, pref));
1195 } 1200 }
OLDNEW
« no previous file with comments | « chrome/browser/android/preferences/important_sites_util.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698