| OLD | NEW |
| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 remove_mask |= BrowsingDataRemover::REMOVE_SITE_DATA; | 334 remove_mask |= BrowsingDataRemover::REMOVE_SITE_DATA; |
| 335 } | 335 } |
| 336 if (passwords) | 336 if (passwords) |
| 337 remove_mask |= BrowsingDataRemover::REMOVE_PASSWORDS; | 337 remove_mask |= BrowsingDataRemover::REMOVE_PASSWORDS; |
| 338 if (form_data) | 338 if (form_data) |
| 339 remove_mask |= BrowsingDataRemover::REMOVE_FORM_DATA; | 339 remove_mask |= BrowsingDataRemover::REMOVE_FORM_DATA; |
| 340 browsing_data_remover->Remove(remove_mask, | 340 browsing_data_remover->Remove(remove_mask, |
| 341 BrowsingDataHelper::UNPROTECTED_WEB); | 341 BrowsingDataHelper::UNPROTECTED_WEB); |
| 342 } | 342 } |
| 343 | 343 |
| 344 static jboolean CanDeleteBrowsingHistory(JNIEnv* env, jobject obj) { |
| 345 return GetPrefService()->GetBoolean(prefs::kAllowDeletingBrowserHistory); |
| 346 } |
| 347 |
| 344 static void SetAllowCookiesEnabled(JNIEnv* env, jobject obj, jboolean allow) { | 348 static void SetAllowCookiesEnabled(JNIEnv* env, jobject obj, jboolean allow) { |
| 345 HostContentSettingsMap* host_content_settings_map = | 349 HostContentSettingsMap* host_content_settings_map = |
| 346 GetOriginalProfile()->GetHostContentSettingsMap(); | 350 GetOriginalProfile()->GetHostContentSettingsMap(); |
| 347 host_content_settings_map->SetDefaultContentSetting( | 351 host_content_settings_map->SetDefaultContentSetting( |
| 348 CONTENT_SETTINGS_TYPE_COOKIES, | 352 CONTENT_SETTINGS_TYPE_COOKIES, |
| 349 allow ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); | 353 allow ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); |
| 350 } | 354 } |
| 351 | 355 |
| 352 static void SetBlockThirdPartyCookiesEnabled(JNIEnv* env, jobject obj, | 356 static void SetBlockThirdPartyCookiesEnabled(JNIEnv* env, jobject obj, |
| 353 jboolean enabled) { | 357 jboolean enabled) { |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 jobject obj) { | 735 jobject obj) { |
| 732 return ConvertUTF8ToJavaString( | 736 return ConvertUTF8ToJavaString( |
| 733 env, | 737 env, |
| 734 GetPrefService()->GetString( | 738 GetPrefService()->GetString( |
| 735 prefs::kSupervisedUserSecondCustodianProfileImageURL)).Release(); | 739 prefs::kSupervisedUserSecondCustodianProfileImageURL)).Release(); |
| 736 } | 740 } |
| 737 | 741 |
| 738 bool RegisterPrefServiceBridge(JNIEnv* env) { | 742 bool RegisterPrefServiceBridge(JNIEnv* env) { |
| 739 return RegisterNativesImpl(env); | 743 return RegisterNativesImpl(env); |
| 740 } | 744 } |
| OLD | NEW |