| 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 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 31 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
| 32 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" | 32 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" |
| 33 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 33 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 34 #include "chrome/browser/history/web_history_service_factory.h" | 34 #include "chrome/browser/history/web_history_service_factory.h" |
| 35 #include "chrome/browser/net/prediction_options.h" | 35 #include "chrome/browser/net/prediction_options.h" |
| 36 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 36 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 37 #include "chrome/browser/profiles/profile_manager.h" | 37 #include "chrome/browser/profiles/profile_manager.h" |
| 38 #include "chrome/browser/sync/profile_sync_service_factory.h" | 38 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 39 #include "chrome/browser/translate/chrome_translate_client.h" | 39 #include "chrome/browser/translate/chrome_translate_client.h" |
| 40 #include "chrome/browser/ui/android/android_about_app_info.h" | 40 #include "chrome/browser/ui/android/android_about_app_info.h" |
| 41 #include "chrome/common/channel_info.h" |
| 41 #include "chrome/common/chrome_features.h" | 42 #include "chrome/common/chrome_features.h" |
| 42 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 43 #include "chrome/grit/locale_settings.h" | 44 #include "chrome/grit/locale_settings.h" |
| 45 #include "components/browser_sync/browser/profile_sync_service.h" |
| 44 #include "components/browsing_data_ui/history_notice_utils.h" | 46 #include "components/browsing_data_ui/history_notice_utils.h" |
| 45 #include "components/content_settings/core/browser/host_content_settings_map.h" | 47 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 46 #include "components/content_settings/core/common/content_settings.h" | 48 #include "components/content_settings/core/common/content_settings.h" |
| 47 #include "components/content_settings/core/common/content_settings_pattern.h" | 49 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 48 #include "components/content_settings/core/common/pref_names.h" | 50 #include "components/content_settings/core/common/pref_names.h" |
| 49 #include "components/metrics/metrics_pref_names.h" | 51 #include "components/metrics/metrics_pref_names.h" |
| 50 #include "components/password_manager/core/common/password_manager_pref_names.h" | 52 #include "components/password_manager/core/common/password_manager_pref_names.h" |
| 51 #include "components/prefs/pref_service.h" | 53 #include "components/prefs/pref_service.h" |
| 52 #include "components/signin/core/common/signin_pref_names.h" | 54 #include "components/signin/core/common/signin_pref_names.h" |
| 53 #include "components/strings/grit/components_locale_settings.h" | 55 #include "components/strings/grit/components_locale_settings.h" |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 browsing_data_ui::ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( | 699 browsing_data_ui::ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( |
| 698 ProfileSyncServiceFactory::GetForProfile(GetOriginalProfile()), | 700 ProfileSyncServiceFactory::GetForProfile(GetOriginalProfile()), |
| 699 WebHistoryServiceFactory::GetForProfile(GetOriginalProfile()), | 701 WebHistoryServiceFactory::GetForProfile(GetOriginalProfile()), |
| 700 base::Bind(&ShowNoticeAboutOtherFormsOfBrowsingHistory, | 702 base::Bind(&ShowNoticeAboutOtherFormsOfBrowsingHistory, |
| 701 base::Owned(new ScopedJavaGlobalRef<jobject>(env, listener)))); | 703 base::Owned(new ScopedJavaGlobalRef<jobject>(env, listener)))); |
| 702 | 704 |
| 703 // The one-time notice in the dialog. | 705 // The one-time notice in the dialog. |
| 704 browsing_data_ui::ShouldPopupDialogAboutOtherFormsOfBrowsingHistory( | 706 browsing_data_ui::ShouldPopupDialogAboutOtherFormsOfBrowsingHistory( |
| 705 ProfileSyncServiceFactory::GetForProfile(GetOriginalProfile()), | 707 ProfileSyncServiceFactory::GetForProfile(GetOriginalProfile()), |
| 706 WebHistoryServiceFactory::GetForProfile(GetOriginalProfile()), | 708 WebHistoryServiceFactory::GetForProfile(GetOriginalProfile()), |
| 709 chrome::GetChannel(), |
| 707 base::Bind(&EnableDialogAboutOtherFormsOfBrowsingHistory, | 710 base::Bind(&EnableDialogAboutOtherFormsOfBrowsingHistory, |
| 708 base::Owned(new ScopedJavaGlobalRef<jobject>(env, listener)))); | 711 base::Owned(new ScopedJavaGlobalRef<jobject>(env, listener)))); |
| 709 } | 712 } |
| 710 | 713 |
| 711 static void SetAutoplayEnabled(JNIEnv* env, | 714 static void SetAutoplayEnabled(JNIEnv* env, |
| 712 const JavaParamRef<jobject>& obj, | 715 const JavaParamRef<jobject>& obj, |
| 713 jboolean allow) { | 716 jboolean allow) { |
| 714 HostContentSettingsMap* host_content_settings_map = | 717 HostContentSettingsMap* host_content_settings_map = |
| 715 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); | 718 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); |
| 716 host_content_settings_map->SetDefaultContentSetting( | 719 host_content_settings_map->SetDefaultContentSetting( |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 | 1143 |
| 1141 return ConvertJavaStringToUTF8(android_permission); | 1144 return ConvertJavaStringToUTF8(android_permission); |
| 1142 } | 1145 } |
| 1143 | 1146 |
| 1144 static void SetSupervisedUserId(JNIEnv* env, | 1147 static void SetSupervisedUserId(JNIEnv* env, |
| 1145 const JavaParamRef<jobject>& obj, | 1148 const JavaParamRef<jobject>& obj, |
| 1146 const JavaParamRef<jstring>& pref) { | 1149 const JavaParamRef<jstring>& pref) { |
| 1147 GetPrefService()->SetString(prefs::kSupervisedUserId, | 1150 GetPrefService()->SetString(prefs::kSupervisedUserId, |
| 1148 ConvertJavaStringToUTF8(env, pref)); | 1151 ConvertJavaStringToUTF8(env, pref)); |
| 1149 } | 1152 } |
| OLD | NEW |