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

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: 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index e7847f655f797c8a42718e5c9eabc60b33550cc7..ffe0c55eecfc9f8ca617ff09066106f74e197d10 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -123,6 +123,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 "extensions/browser/extension_host.h"
#include "extensions/browser/extension_message_filter.h"
@@ -2098,6 +2099,12 @@ void ChromeContentBrowserClient::ShowDesktopNotification(
DesktopNotificationServiceFactory::GetForProfile(profile);
service->ShowDesktopNotification(
params, render_frame_host, delegate, cancel_callback);
+
+ UseContentSettingPermissionHelper(
+ profile,
+ params.origin,
+ params.origin,
+ content_settings::GetTypeName(CONTENT_SETTINGS_TYPE_NOTIFICATIONS));
#else
NOTIMPLEMENTED();
#endif
@@ -2132,6 +2139,29 @@ void ChromeContentBrowserClient::RequestMidiSysExPermission(
cancel_callback);
}
+void ChromeContentBrowserClient::UseContentSettingPermission(
+ content::WebContents* web_contents,
+ const GURL& primary_url,
+ const GURL& secondary_url,
+ const std::string& setting_type) {
+ UseContentSettingPermissionHelper(
+ Profile::FromBrowserContext(web_contents->GetBrowserContext()),
+ primary_url,
+ secondary_url,
+ setting_type);
+}
+
+void ChromeContentBrowserClient::UseContentSettingPermissionHelper(
Michael van Ouwerkerk 2014/07/01 11:02:23 Why do you need this method? It makes one simple c
Daniel Nishi 2014/07/01 18:37:48 |UseContentSettingPermission| is called from conte
+ Profile* profile,
+ const GURL& primary_url,
+ const GURL& secondary_url,
+ const std::string& setting_type) {
+ profile->GetHostContentSettingsMap()->UpdateLastUsage(
+ primary_url,
+ secondary_url,
+ content_settings::GetTypeFromName(setting_type));
+}
+
void ChromeContentBrowserClient::RequestProtectedMediaIdentifierPermission(
content::WebContents* web_contents,
const GURL& origin,

Powered by Google App Engine
This is Rietveld 408576698