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 25 matching lines...) Expand all Loading... |
36 #include "chrome/browser/profiles/profile_manager.h" | 36 #include "chrome/browser/profiles/profile_manager.h" |
37 #include "chrome/browser/sync/profile_sync_service_factory.h" | 37 #include "chrome/browser/sync/profile_sync_service_factory.h" |
38 #include "chrome/browser/translate/chrome_translate_client.h" | 38 #include "chrome/browser/translate/chrome_translate_client.h" |
39 #include "chrome/browser/ui/android/android_about_app_info.h" | 39 #include "chrome/browser/ui/android/android_about_app_info.h" |
40 #include "chrome/common/channel_info.h" | 40 #include "chrome/common/channel_info.h" |
41 #include "chrome/common/chrome_features.h" | 41 #include "chrome/common/chrome_features.h" |
42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
43 #include "chrome/grit/locale_settings.h" | 43 #include "chrome/grit/locale_settings.h" |
44 #include "components/browser_sync/profile_sync_service.h" | 44 #include "components/browser_sync/profile_sync_service.h" |
45 #include "components/browsing_data/core/browsing_data_utils.h" | 45 #include "components/browsing_data/core/browsing_data_utils.h" |
| 46 #include "components/browsing_data/core/history_notice_utils.h" |
46 #include "components/browsing_data/core/pref_names.h" | 47 #include "components/browsing_data/core/pref_names.h" |
47 #include "components/browsing_data_ui/history_notice_utils.h" | |
48 #include "components/content_settings/core/browser/host_content_settings_map.h" | 48 #include "components/content_settings/core/browser/host_content_settings_map.h" |
49 #include "components/content_settings/core/common/content_settings.h" | 49 #include "components/content_settings/core/common/content_settings.h" |
50 #include "components/content_settings/core/common/content_settings_pattern.h" | 50 #include "components/content_settings/core/common/content_settings_pattern.h" |
51 #include "components/content_settings/core/common/pref_names.h" | 51 #include "components/content_settings/core/common/pref_names.h" |
52 #include "components/metrics/metrics_pref_names.h" | 52 #include "components/metrics/metrics_pref_names.h" |
53 #include "components/password_manager/core/common/password_manager_pref_names.h" | 53 #include "components/password_manager/core/common/password_manager_pref_names.h" |
54 #include "components/prefs/pref_service.h" | 54 #include "components/prefs/pref_service.h" |
55 #include "components/signin/core/common/signin_pref_names.h" | 55 #include "components/signin/core/common/signin_pref_names.h" |
56 #include "components/strings/grit/components_locale_settings.h" | 56 #include "components/strings/grit/components_locale_settings.h" |
57 #include "components/translate/core/browser/translate_prefs.h" | 57 #include "components/translate/core/browser/translate_prefs.h" |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 return; | 764 return; |
765 Java_OtherFormsOfBrowsingHistoryListener_enableDialogAboutOtherFormsOfBrowsing
History( | 765 Java_OtherFormsOfBrowsingHistoryListener_enableDialogAboutOtherFormsOfBrowsing
History( |
766 env, listener->obj()); | 766 env, listener->obj()); |
767 } | 767 } |
768 | 768 |
769 static void RequestInfoAboutOtherFormsOfBrowsingHistory( | 769 static void RequestInfoAboutOtherFormsOfBrowsingHistory( |
770 JNIEnv* env, | 770 JNIEnv* env, |
771 const JavaParamRef<jobject>& obj, | 771 const JavaParamRef<jobject>& obj, |
772 const JavaParamRef<jobject>& listener) { | 772 const JavaParamRef<jobject>& listener) { |
773 // The permanent notice in the footer. | 773 // The permanent notice in the footer. |
774 browsing_data_ui::ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( | 774 browsing_data::ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( |
775 ProfileSyncServiceFactory::GetForProfile(GetOriginalProfile()), | 775 ProfileSyncServiceFactory::GetForProfile(GetOriginalProfile()), |
776 WebHistoryServiceFactory::GetForProfile(GetOriginalProfile()), | 776 WebHistoryServiceFactory::GetForProfile(GetOriginalProfile()), |
777 base::Bind(&ShowNoticeAboutOtherFormsOfBrowsingHistory, | 777 base::Bind(&ShowNoticeAboutOtherFormsOfBrowsingHistory, |
778 base::Owned(new ScopedJavaGlobalRef<jobject>(env, listener)))); | 778 base::Owned(new ScopedJavaGlobalRef<jobject>(env, listener)))); |
779 | 779 |
780 // The one-time notice in the dialog. | 780 // The one-time notice in the dialog. |
781 browsing_data_ui::ShouldPopupDialogAboutOtherFormsOfBrowsingHistory( | 781 browsing_data::ShouldPopupDialogAboutOtherFormsOfBrowsingHistory( |
782 ProfileSyncServiceFactory::GetForProfile(GetOriginalProfile()), | 782 ProfileSyncServiceFactory::GetForProfile(GetOriginalProfile()), |
783 WebHistoryServiceFactory::GetForProfile(GetOriginalProfile()), | 783 WebHistoryServiceFactory::GetForProfile(GetOriginalProfile()), |
784 chrome::GetChannel(), | 784 chrome::GetChannel(), |
785 base::Bind(&EnableDialogAboutOtherFormsOfBrowsingHistory, | 785 base::Bind(&EnableDialogAboutOtherFormsOfBrowsingHistory, |
786 base::Owned(new ScopedJavaGlobalRef<jobject>(env, listener)))); | 786 base::Owned(new ScopedJavaGlobalRef<jobject>(env, listener)))); |
787 } | 787 } |
788 | 788 |
789 static void SetAutoplayEnabled(JNIEnv* env, | 789 static void SetAutoplayEnabled(JNIEnv* env, |
790 const JavaParamRef<jobject>& obj, | 790 const JavaParamRef<jobject>& obj, |
791 jboolean allow) { | 791 jboolean allow) { |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 | 1205 |
1206 return ConvertJavaStringToUTF8(android_permission); | 1206 return ConvertJavaStringToUTF8(android_permission); |
1207 } | 1207 } |
1208 | 1208 |
1209 static void SetSupervisedUserId(JNIEnv* env, | 1209 static void SetSupervisedUserId(JNIEnv* env, |
1210 const JavaParamRef<jobject>& obj, | 1210 const JavaParamRef<jobject>& obj, |
1211 const JavaParamRef<jstring>& pref) { | 1211 const JavaParamRef<jstring>& pref) { |
1212 GetPrefService()->SetString(prefs::kSupervisedUserId, | 1212 GetPrefService()->SetString(prefs::kSupervisedUserId, |
1213 ConvertJavaStringToUTF8(env, pref)); | 1213 ConvertJavaStringToUTF8(env, pref)); |
1214 } | 1214 } |
OLD | NEW |