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

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

Issue 2577613003: [ImportantSites] Fixed important sites metrics & blacklisting (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 base::android::AppendJavaStringArrayToStringVector( 640 base::android::AppendJavaStringArrayToStringVector(
641 env, jignoring_domains.obj(), &ignoring_domains); 641 env, jignoring_domains.obj(), &ignoring_domains);
642 base::android::JavaIntArrayToIntVector(env, jignoring_domain_reasons.obj(), 642 base::android::JavaIntArrayToIntVector(env, jignoring_domain_reasons.obj(),
643 &ignoring_domain_reasons); 643 &ignoring_domain_reasons);
644 std::unique_ptr<RegistrableDomainFilterBuilder> filter_builder( 644 std::unique_ptr<RegistrableDomainFilterBuilder> filter_builder(
645 new RegistrableDomainFilterBuilder(BrowsingDataFilterBuilder::BLACKLIST)); 645 new RegistrableDomainFilterBuilder(BrowsingDataFilterBuilder::BLACKLIST));
646 for (const std::string& domain : excluding_domains) { 646 for (const std::string& domain : excluding_domains) {
647 filter_builder->AddRegisterableDomain(domain); 647 filter_builder->AddRegisterableDomain(domain);
648 } 648 }
649 649
650 if (!excluding_domains.empty()) { 650 if (!excluding_domains.empty() || !ignoring_domains.empty()) {
651 ImportantSitesUtil::RecordBlacklistedAndIgnoredImportantSites( 651 ImportantSitesUtil::RecordBlacklistedAndIgnoredImportantSites(
652 GetOriginalProfile(), excluding_domains, excluding_domain_reasons, 652 GetOriginalProfile(), excluding_domains, excluding_domain_reasons,
653 ignoring_domains, ignoring_domain_reasons); 653 ignoring_domains, ignoring_domain_reasons);
654 } 654 }
655 655
656 // Delete the filterable types with a filter, and the rest completely. 656 // Delete the filterable types with a filter, and the rest completely.
657 // TODO(msramek): This is only necessary until the filter is implemented in 657 // TODO(msramek): This is only necessary until the filter is implemented in
658 // all data storage backends. 658 // all data storage backends.
659 int filterable_mask = remove_mask & BrowsingDataRemover::FILTERABLE_DATATYPES; 659 int filterable_mask = remove_mask & BrowsingDataRemover::FILTERABLE_DATATYPES;
660 int nonfilterable_mask = 660 int nonfilterable_mask =
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 1210
1211 return ConvertJavaStringToUTF8(android_permission); 1211 return ConvertJavaStringToUTF8(android_permission);
1212 } 1212 }
1213 1213
1214 static void SetSupervisedUserId(JNIEnv* env, 1214 static void SetSupervisedUserId(JNIEnv* env,
1215 const JavaParamRef<jobject>& obj, 1215 const JavaParamRef<jobject>& obj,
1216 const JavaParamRef<jstring>& pref) { 1216 const JavaParamRef<jstring>& pref) {
1217 GetPrefService()->SetString(prefs::kSupervisedUserId, 1217 GetPrefService()->SetString(prefs::kSupervisedUserId,
1218 ConvertJavaStringToUTF8(env, pref)); 1218 ConvertJavaStringToUTF8(env, pref));
1219 } 1219 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698