| 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 500fe7045577962fa2c269c6b8c252474351d4e3..4b3954efecdfa61e5345abd491e3a722a466ded1 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"
|
| @@ -741,6 +742,36 @@ static void ClearBannerData(JNIEnv* env,
|
| CONTENT_SETTINGS_TYPE_APP_BANNER, std::string(), nullptr);
|
| }
|
|
|
| +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);
|
|
|