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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 356543003: Audit the last usage of Geolocation and Notification permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jam nits. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index fc13b031cd3e99dc5875586920794901b4fc63db..75c6230adac91bbc7a131ce2e4ac0a3d3ecf00cf 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -124,6 +124,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/child_process_host.h"
#include "content/public/common/content_descriptors.h"
+#include "content/public/common/show_desktop_notification_params.h"
#include "content/public/common/url_utils.h"
#include "content/public/common/web_preferences.h"
#include "extensions/browser/extension_host.h"
@@ -2181,6 +2182,9 @@ void ChromeContentBrowserClient::ShowDesktopNotification(
DesktopNotificationServiceFactory::GetForProfile(profile);
service->ShowDesktopNotification(
params, render_frame_host, delegate, cancel_callback);
+
+ profile->GetHostContentSettingsMap()->UpdateLastUsage(
+ params.origin, params.origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
#else
NOTIMPLEMENTED();
#endif
@@ -2218,6 +2222,16 @@ void ChromeContentBrowserClient::RequestMidiSysExPermission(
user_gesture, result_callback);
}
+void ChromeContentBrowserClient::DidUseGeolocationPermission(
+ content::WebContents* web_contents,
+ const GURL& frame_url,
+ const GURL& main_frame_url) {
+ Profile::FromBrowserContext(web_contents->GetBrowserContext())
+ ->GetHostContentSettingsMap()
+ ->UpdateLastUsage(
+ frame_url, main_frame_url, CONTENT_SETTINGS_TYPE_GEOLOCATION);
+}
+
void ChromeContentBrowserClient::RequestProtectedMediaIdentifierPermission(
content::WebContents* web_contents,
const GURL& origin,

Powered by Google App Engine
This is Rietveld 408576698