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

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: Add auditing for actual usage, too. 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 2d605f819ea3475e513bbbbad2f9711825e2c61b..438916e7c96cc37ea6c5a2f1c80e70d5f18309e3 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -481,11 +481,12 @@ void DesktopNotificationService::ResetAllOrigins() {
ContentSetting DesktopNotificationService::GetContentSetting(
const GURL& origin) {
- return profile_->GetHostContentSettingsMap()->GetContentSetting(
- origin,
- origin,
- CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
- NO_RESOURCE_IDENTIFIER);
+ return profile_->GetHostContentSettingsMap()
+ ->GetContentSettingAndMaybeUpdateLastUsage(
+ origin,
+ origin,
+ CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
+ NO_RESOURCE_IDENTIFIER);
}
void DesktopNotificationService::RequestPermission(
@@ -499,6 +500,7 @@ void DesktopNotificationService::RequestPermission(
WebContents* web_contents = WebContents::FromRenderFrameHost(
render_frame_host);
ContentSetting setting = GetContentSetting(origin);
+
if (setting == CONTENT_SETTING_ASK) {
if (PermissionBubbleManager::Enabled()) {
PermissionBubbleManager* bubble_manager =

Powered by Google App Engine
This is Rietveld 408576698