| Index: chrome/browser/android/preferences/website_preference_bridge.cc
|
| diff --git a/chrome/browser/android/preferences/website_preference_bridge.cc b/chrome/browser/android/preferences/website_preference_bridge.cc
|
| index f87de66a5a1e5a3f784e21d4759d8c4426c1ac7b..ce5fa2505608ff660de34c9d99e43b10ac02fab0 100644
|
| --- a/chrome/browser/android/preferences/website_preference_bridge.cc
|
| +++ b/chrome/browser/android/preferences/website_preference_bridge.cc
|
| @@ -18,6 +18,7 @@
|
| #include "base/json/json_writer.h"
|
| #include "base/logging.h"
|
| #include "base/macros.h"
|
| +#include "chrome/browser/android/search_geolocation/search_geolocation_service.h"
|
| #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h"
|
| #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
|
| #include "chrome/browser/browsing_data/browsing_data_quota_helper.h"
|
| @@ -753,6 +754,36 @@ static void ClearBannerData(JNIEnv* env,
|
| builder.BuildWebsiteSettingsPatternMatchesFilter()));
|
| }
|
|
|
| +static jboolean ShouldUseDSEGeolocationSetting(
|
| + JNIEnv* env,
|
| + const JavaParamRef<jclass>& clazz,
|
| + const JavaParamRef<jstring>& jorigin,
|
| + jboolean is_incognito) {
|
| + SearchGeolocationService* search_helper =
|
| + SearchGeolocationService::Factory::GetForBrowserContext(
|
| + GetActiveUserProfile(is_incognito));
|
| + return search_helper &&
|
| + search_helper->UseDSEGeolocationSetting(
|
| + url::Origin(GURL(ConvertJavaStringToUTF8(env, jorigin))));
|
| +}
|
| +
|
| +static jboolean GetDSEGeolocationSetting(JNIEnv* env,
|
| + const JavaParamRef<jclass>& clazz) {
|
| + SearchGeolocationService* search_helper =
|
| + SearchGeolocationService::Factory::GetForBrowserContext(
|
| + GetActiveUserProfile(false /* is_incognito */));
|
| + return search_helper->GetDSEGeolocationSetting();
|
| +}
|
| +
|
| +static void SetDSEGeolocationSetting(JNIEnv* env,
|
| + const JavaParamRef<jclass>& clazz,
|
| + jboolean setting) {
|
| + SearchGeolocationService* search_helper =
|
| + SearchGeolocationService::Factory::GetForBrowserContext(
|
| + GetActiveUserProfile(false /* is_incognito */));
|
| + return search_helper->SetDSEGeolocationSetting(setting);
|
| +}
|
| +
|
| // Register native methods
|
| bool RegisterWebsitePreferenceBridge(JNIEnv* env) {
|
| return RegisterNativesImpl(env);
|
|
|