OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/android/callback_android.h" | 9 #include "base/android/callback_android.h" |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 } | 180 } |
181 | 181 |
182 // Add the DSE origin if it allows geolocation. | 182 // Add the DSE origin if it allows geolocation. |
183 if (content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { | 183 if (content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { |
184 SearchGeolocationService* search_helper = | 184 SearchGeolocationService* search_helper = |
185 SearchGeolocationService::Factory::GetForBrowserContext( | 185 SearchGeolocationService::Factory::GetForBrowserContext( |
186 GetActiveUserProfile(false /* is_incognito */)); | 186 GetActiveUserProfile(false /* is_incognito */)); |
187 if (search_helper) { | 187 if (search_helper) { |
188 const url::Origin& dse_origin = search_helper->GetDSEOriginIfEnabled(); | 188 const url::Origin& dse_origin = search_helper->GetDSEOriginIfEnabled(); |
189 if (!dse_origin.unique()) { | 189 if (!dse_origin.opaque()) { |
190 std::string dse_origin_string = dse_origin.Serialize(); | 190 std::string dse_origin_string = dse_origin.Serialize(); |
191 if (!base::ContainsValue(seen_origins, dse_origin_string)) { | 191 if (!base::ContainsValue(seen_origins, dse_origin_string)) { |
192 seen_origins.push_back(dse_origin_string); | 192 seen_origins.push_back(dse_origin_string); |
193 insertionFunc(env, list, | 193 insertionFunc(env, list, |
194 ConvertOriginToJavaString(env, dse_origin_string), | 194 ConvertOriginToJavaString(env, dse_origin_string), |
195 jembedder); | 195 jembedder); |
196 } | 196 } |
197 } | 197 } |
198 } | 198 } |
199 } | 199 } |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 return search_helper->SetDSEGeolocationSetting(setting); | 858 return search_helper->SetDSEGeolocationSetting(setting); |
859 } | 859 } |
860 | 860 |
861 static jboolean GetAdBlockingActivated(JNIEnv* env, | 861 static jboolean GetAdBlockingActivated(JNIEnv* env, |
862 const JavaParamRef<jclass>& clazz, | 862 const JavaParamRef<jclass>& clazz, |
863 const JavaParamRef<jstring>& jorigin) { | 863 const JavaParamRef<jstring>& jorigin) { |
864 GURL url(ConvertJavaStringToUTF8(env, jorigin)); | 864 GURL url(ConvertJavaStringToUTF8(env, jorigin)); |
865 return !!GetHostContentSettingsMap(false)->GetWebsiteSetting( | 865 return !!GetHostContentSettingsMap(false)->GetWebsiteSetting( |
866 url, GURL(), CONTENT_SETTINGS_TYPE_ADS_DATA, std::string(), nullptr); | 866 url, GURL(), CONTENT_SETTINGS_TYPE_ADS_DATA, std::string(), nullptr); |
867 } | 867 } |
OLD | NEW |