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

Unified Diff: components/content_settings/core/browser/host_content_settings_map.h

Issue 2816723002: Add "Site Settings" option to Clear Browsing Data on Android (Closed)
Patch Set: fix deps Created 3 years, 7 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: components/content_settings/core/browser/host_content_settings_map.h
diff --git a/components/content_settings/core/browser/host_content_settings_map.h b/components/content_settings/core/browser/host_content_settings_map.h
index 63c23d59a8061ae5bb8845bc9ff1f3441a2826c0..51119379e5cd9a0a7cd28d6f92a33ab41be219a4 100644
--- a/components/content_settings/core/browser/host_content_settings_map.h
+++ b/components/content_settings/core/browser/host_content_settings_map.h
@@ -31,6 +31,7 @@ class PrefService;
namespace base {
class Value;
+class Clock;
}
namespace content_settings {
@@ -218,6 +219,16 @@ class HostContentSettingsMap : public content_settings::Observer,
// This should only be called on the UI thread.
void ClearSettingsForOneType(ContentSettingsType content_type);
+ // Return the |last_modified| date of a content setting. This will only return
+ // valid values for settings from the PreferenceProvider. Settings from other
+ // providers will return base::Time().
+ //
+ // This may be called on any thread.
+ base::Time GetSettingLastModifiedDate(
+ const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern,
+ ContentSettingsType content_type) const;
+
using PatternSourcePredicate =
base::Callback<bool(const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern)>;
@@ -272,6 +283,10 @@ class HostContentSettingsMap : public content_settings::Observer,
base::WeakPtr<HostContentSettingsMap> GetWeakPtr();
+ // Injects a clock into the PrefProvider to allow control over the
+ // |last_modified| timestamp.
+ void SetClockForTesting(std::unique_ptr<base::Clock> clock);
+
private:
friend class base::RefCountedThreadSafe<HostContentSettingsMap>;

Powered by Google App Engine
This is Rietveld 408576698