Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: chrome/browser/android/preferences/website_address.cc

Issue 927763003: Move website settings fetching from WebsitePreferences to new WebsitePermissionFetcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/android/preferences/website_address.h"
6
7 #include "base/android/jni_string.h"
8 #include "components/content_settings/core/common/content_settings_pattern.h"
9 #include "jni/WebsiteAddress_jni.h"
10 #include "url/gurl.h"
11
12 jboolean HasSameContentSettingsOrigin(JNIEnv* env,
13 jclass clazz,
14 jstring url1,
15 jstring url2) {
16 // This uses the same origin matching logic as many of the content settings.
17 // TODO(sashab): Remove this and individually fetch origin settings in
18 // WebsitePermissionsFetcher instead of filtering afterwards this way.
19 GURL gurl1 = GURL(base::android::ConvertJavaStringToUTF8(env, url1));
20 GURL gurl2 = GURL(base::android::ConvertJavaStringToUTF8(env, url2));
21 return ContentSettingsPattern::FromURL(gurl1).Matches(gurl2);
Peter Beverloo 2015/02/17 15:06:46 We should verify that this in fact works for most
sashab 2015/02/18 05:28:32 Agreed. Maybe the best thing to do for now is just
Michael van Ouwerkerk 2015/02/18 19:57:39 Verified that this works for the single site scree
Michael van Ouwerkerk 2015/02/18 19:57:39 Acknowledged.
22 }
23
24 // Register native methods
25 bool RegisterWebsiteAddress(JNIEnv* env) {
26 return RegisterNativesImpl(env);
27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698