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

Unified Diff: chrome/browser/content_settings/content_settings_pref_provider.h

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/content_settings/content_settings_pref_provider.h
diff --git a/chrome/browser/content_settings/content_settings_pref_provider.h b/chrome/browser/content_settings/content_settings_pref_provider.h
index 9d8a2bcba85cd040601ca7c616b3483b739f0dbd..08a9d1b9b415f369b84c748894ac4920cd5b8981 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider.h
+++ b/chrome/browser/content_settings/content_settings_pref_provider.h
@@ -19,6 +19,7 @@
class PrefService;
namespace base {
+class Clock;
class DictionaryValue;
}
@@ -55,6 +56,18 @@ class PrefProvider : public ObservableProvider {
virtual void ShutdownOnUIThread() OVERRIDE;
+ // Records the last time the given pattern has used a certain content setting.
+ void UpdateLastUsage(const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern,
+ ContentSettingsType content_type);
+
+ base::Time GetLastUsage(const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern,
+ ContentSettingsType content_type);
+
+ // Gains ownership of |clock|.
+ void SetClockForTesting(scoped_ptr<base::Clock> clock);
+
private:
friend class DeadlockCheckerThread; // For testing.
// Reads all content settings exceptions from the preference and load them
@@ -90,6 +103,9 @@ class PrefProvider : public ObservableProvider {
// Weak; owned by the Profile and reset in ShutdownOnUIThread.
PrefService* prefs_;
+ // Can be set for testing.
+ scoped_ptr<base::Clock> clock_;
+
bool is_incognito_;
PrefChangeRegistrar pref_change_registrar_;

Powered by Google App Engine
This is Rietveld 408576698