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

Unified Diff: chrome/browser/notifications/desktop_notification_service.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: Created 6 years, 6 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/notifications/desktop_notification_service.cc
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index c2b10ad419348f9677a1ba5b7a72b937db7e4ee1..153673c8e66ad7ae629d06acf8ef46d1587ee1a1 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -433,6 +433,8 @@ DesktopNotificationService::~DesktopNotificationService() {
void DesktopNotificationService::GrantPermission(const GURL& origin) {
ContentSettingsPattern primary_pattern =
ContentSettingsPattern::FromURLNoWildcard(origin);
+ profile_->GetHostContentSettingsMap()->UpdateLastUsage(
dewittj 2014/06/26 15:56:51 Why isn't this just done inside SetContentSetting?
Daniel Nishi 2014/06/26 20:31:25 Good point. I've moved this part into SetContentSe
+ origin, origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
profile_->GetHostContentSettingsMap()->SetContentSetting(
primary_pattern,
ContentSettingsPattern::Wildcard(),
@@ -512,6 +514,12 @@ void DesktopNotificationService::RequestPermission(
WebContents* web_contents = WebContents::FromRenderFrameHost(
render_frame_host);
ContentSetting setting = GetContentSetting(origin);
+
+ if (setting == CONTENT_SETTING_ALLOW) {
dewittj 2014/06/26 15:56:51 why only content setting allow? This is probably
Daniel Nishi 2014/06/26 20:31:25 It's on allow because we're trying to track when t
+ profile_->GetHostContentSettingsMap()->UpdateLastUsage(
+ origin, origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
+ }
+
if (setting == CONTENT_SETTING_ASK) {
if (PermissionBubbleManager::Enabled()) {
PermissionBubbleManager* bubble_manager =

Powered by Google App Engine
This is Rietveld 408576698