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

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

Issue 2165733003: Add revocation reporter to permission util (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-source-ui-to-permission-report
Patch Set: merge Created 4 years, 5 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
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 "chrome/browser/android/preferences/website_preference_bridge.h" 5 #include "chrome/browser/android/preferences/website_preference_bridge.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 void SetSettingForOrigin(JNIEnv* env, 145 void SetSettingForOrigin(JNIEnv* env,
146 ContentSettingsType content_type, 146 ContentSettingsType content_type,
147 jstring origin, 147 jstring origin,
148 jstring embedder, 148 jstring embedder,
149 ContentSetting setting, 149 ContentSetting setting,
150 jboolean is_incognito) { 150 jboolean is_incognito) {
151 GURL origin_url(ConvertJavaStringToUTF8(env, origin)); 151 GURL origin_url(ConvertJavaStringToUTF8(env, origin));
152 GURL embedder_url = 152 GURL embedder_url =
153 embedder ? GURL(ConvertJavaStringToUTF8(env, embedder)) : GURL(); 153 embedder ? GURL(ConvertJavaStringToUTF8(env, embedder)) : GURL();
154 PermissionUtil::SetContentSettingAndRecordRevocation( 154 Profile* profile = GetActiveUserProfile(is_incognito);
155 GetActiveUserProfile(is_incognito), origin_url, embedder_url, 155 PermissionUtil::RevocationReporter scoped_revocation_reporter(
156 content_type, std::string(), setting); 156 profile, origin_url, embedder_url, content_type, std::string(),
157 PermissionSourceUI::SITE_SETTING);
158 HostContentSettingsMapFactory::GetForProfile(profile)
159 ->SetContentSettingDefaultScope(origin_url, embedder_url, content_type,
160 std::string(), setting);
157 WebSiteSettingsUmaUtil::LogPermissionChange(content_type, setting); 161 WebSiteSettingsUmaUtil::LogPermissionChange(content_type, setting);
158 } 162 }
159 163
160 } // anonymous namespace 164 } // anonymous namespace
161 165
162 static void GetFullscreenOrigins(JNIEnv* env, 166 static void GetFullscreenOrigins(JNIEnv* env,
163 const JavaParamRef<jclass>& clazz, 167 const JavaParamRef<jclass>& clazz,
164 const JavaParamRef<jobject>& list, 168 const JavaParamRef<jobject>& list,
165 jboolean managedOnly) { 169 jboolean managedOnly) {
166 GetOrigins(env, CONTENT_SETTINGS_TYPE_FULLSCREEN, 170 GetOrigins(env, CONTENT_SETTINGS_TYPE_FULLSCREEN,
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 GURL url(ConvertJavaStringToUTF8(env, jorigin)); 722 GURL url(ConvertJavaStringToUTF8(env, jorigin));
719 scoped_refptr<SiteDataDeleteHelper> site_data_deleter( 723 scoped_refptr<SiteDataDeleteHelper> site_data_deleter(
720 new SiteDataDeleteHelper(profile, url)); 724 new SiteDataDeleteHelper(profile, url));
721 site_data_deleter->Run(); 725 site_data_deleter->Run();
722 } 726 }
723 727
724 // Register native methods 728 // Register native methods
725 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { 729 bool RegisterWebsitePreferenceBridge(JNIEnv* env) {
726 return RegisterNativesImpl(env); 730 return RegisterNativesImpl(env);
727 } 731 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_util.h » ('j') | chrome/browser/permissions/permission_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698