| 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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 const JavaParamRef<jobject>& java_callback) { | 629 const JavaParamRef<jobject>& java_callback) { |
| 630 std::vector<std::string> important_domains = | 630 std::vector<std::string> important_domains = |
| 631 ImportantSitesUtil::GetImportantRegisterableDomains(GetOriginalProfile(), | 631 ImportantSitesUtil::GetImportantRegisterableDomains(GetOriginalProfile(), |
| 632 kMaxImportantSites); | 632 kMaxImportantSites); |
| 633 ScopedJavaLocalRef<jobjectArray> string_array = | 633 ScopedJavaLocalRef<jobjectArray> string_array = |
| 634 base::android::ToJavaArrayOfStrings(env, important_domains); | 634 base::android::ToJavaArrayOfStrings(env, important_domains); |
| 635 Java_ImportantSitesCallback_onImportantRegisterableDomainsReady( | 635 Java_ImportantSitesCallback_onImportantRegisterableDomainsReady( |
| 636 env, java_callback.obj(), string_array.obj()); | 636 env, java_callback.obj(), string_array.obj()); |
| 637 } | 637 } |
| 638 | 638 |
| 639 static jint GetMaxImportantSites(JNIEnv* env, |
| 640 const JavaParamRef<jclass>& clazz) { |
| 641 return kMaxImportantSites; |
| 642 } |
| 643 |
| 639 static void ShowNoticeAboutOtherFormsOfBrowsingHistory( | 644 static void ShowNoticeAboutOtherFormsOfBrowsingHistory( |
| 640 ScopedJavaGlobalRef<jobject>* listener, | 645 ScopedJavaGlobalRef<jobject>* listener, |
| 641 bool show) { | 646 bool show) { |
| 642 JNIEnv* env = AttachCurrentThread(); | 647 JNIEnv* env = AttachCurrentThread(); |
| 643 if (!show) | 648 if (!show) |
| 644 return; | 649 return; |
| 645 Java_OtherFormsOfBrowsingHistoryListener_showNoticeAboutOtherFormsOfBrowsingHi
story( | 650 Java_OtherFormsOfBrowsingHistoryListener_showNoticeAboutOtherFormsOfBrowsingHi
story( |
| 646 env, listener->obj()); | 651 env, listener->obj()); |
| 647 } | 652 } |
| 648 | 653 |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 | 1096 |
| 1092 return ConvertJavaStringToUTF8(android_permission); | 1097 return ConvertJavaStringToUTF8(android_permission); |
| 1093 } | 1098 } |
| 1094 | 1099 |
| 1095 static void SetSupervisedUserId(JNIEnv* env, | 1100 static void SetSupervisedUserId(JNIEnv* env, |
| 1096 const JavaParamRef<jobject>& obj, | 1101 const JavaParamRef<jobject>& obj, |
| 1097 const JavaParamRef<jstring>& pref) { | 1102 const JavaParamRef<jstring>& pref) { |
| 1098 GetPrefService()->SetString(prefs::kSupervisedUserId, | 1103 GetPrefService()->SetString(prefs::kSupervisedUserId, |
| 1099 ConvertJavaStringToUTF8(env, pref)); | 1104 ConvertJavaStringToUTF8(env, pref)); |
| 1100 } | 1105 } |
| OLD | NEW |