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

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

Issue 974463002: Respect prefs::kAllowDeletingBrowserHistory in the Clear History UI on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 remove_mask |= BrowsingDataRemover::REMOVE_SITE_DATA; 324 remove_mask |= BrowsingDataRemover::REMOVE_SITE_DATA;
325 } 325 }
326 if (passwords) 326 if (passwords)
327 remove_mask |= BrowsingDataRemover::REMOVE_PASSWORDS; 327 remove_mask |= BrowsingDataRemover::REMOVE_PASSWORDS;
328 if (form_data) 328 if (form_data)
329 remove_mask |= BrowsingDataRemover::REMOVE_FORM_DATA; 329 remove_mask |= BrowsingDataRemover::REMOVE_FORM_DATA;
330 browsing_data_remover->Remove(remove_mask, 330 browsing_data_remover->Remove(remove_mask,
331 BrowsingDataHelper::UNPROTECTED_WEB); 331 BrowsingDataHelper::UNPROTECTED_WEB);
332 } 332 }
333 333
334 static jboolean CanDeleteBrowsingHistory(JNIEnv* env, jobject obj) {
335 return GetPrefService()->GetBoolean(prefs::kAllowDeletingBrowserHistory);
336 }
337
334 static void SetAllowCookiesEnabled(JNIEnv* env, jobject obj, jboolean allow) { 338 static void SetAllowCookiesEnabled(JNIEnv* env, jobject obj, jboolean allow) {
335 HostContentSettingsMap* host_content_settings_map = 339 HostContentSettingsMap* host_content_settings_map =
336 GetOriginalProfile()->GetHostContentSettingsMap(); 340 GetOriginalProfile()->GetHostContentSettingsMap();
337 host_content_settings_map->SetDefaultContentSetting( 341 host_content_settings_map->SetDefaultContentSetting(
338 CONTENT_SETTINGS_TYPE_COOKIES, 342 CONTENT_SETTINGS_TYPE_COOKIES,
339 allow ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); 343 allow ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK);
340 } 344 }
341 345
342 static void SetBlockThirdPartyCookiesEnabled(JNIEnv* env, jobject obj, 346 static void SetBlockThirdPartyCookiesEnabled(JNIEnv* env, jobject obj,
343 jboolean enabled) { 347 jboolean enabled) {
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 jobject obj) { 730 jobject obj) {
727 return ConvertUTF8ToJavaString( 731 return ConvertUTF8ToJavaString(
728 env, 732 env,
729 GetPrefService()->GetString( 733 GetPrefService()->GetString(
730 prefs::kSupervisedUserSecondCustodianProfileImageURL)).Release(); 734 prefs::kSupervisedUserSecondCustodianProfileImageURL)).Release();
731 } 735 }
732 736
733 bool RegisterPrefServiceBridge(JNIEnv* env) { 737 bool RegisterPrefServiceBridge(JNIEnv* env) {
734 return RegisterNativesImpl(env); 738 return RegisterNativesImpl(env);
735 } 739 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698