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

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

Issue 1412523003: Adding <keygen> Content Setting (UI) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing page action. Created 5 years 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.cc
diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc
index 2f2b7cf5d701686c9e73c87f2710954ddf9e18a4..498e80763872ef5c86c9390f056e9c51d3d857ff 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -341,7 +341,8 @@ void HostContentSettingsMap::SetNarrowestContentSetting(
type == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING) {
primary_pattern = ContentSettingsPattern::FromURL(primary_url);
secondary_pattern = ContentSettingsPattern::Wildcard();
- } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC ||
+ } else if (type == CONTENT_SETTINGS_TYPE_KEYGEN ||
+ type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC ||
type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA ||
type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
primary_pattern = ContentSettingsPattern::FromURLNoWildcard(primary_url);
@@ -469,6 +470,21 @@ base::Time HostContentSettingsMap::GetLastUsageByPattern(
primary_pattern, secondary_pattern, content_type);
}
+void HostContentSettingsMap::SetShouldDisplay(
+ const GURL& url,
+ ContentSettingsType content_type) {
+ if (display_map_.find(url) == display_map_.end())
+ display_map_[url] = std::set<ContentSettingsType>();
+ display_map_[url].insert(content_type);
+}
+
+bool HostContentSettingsMap::ShouldDisplay(const GURL& url,
+ ContentSettingsType content_type) {
+ if (display_map_.find(url) != display_map_.end())
+ return display_map_[url].count(content_type) != 0;
+ return false;
+}
+
void HostContentSettingsMap::AddObserver(content_settings::Observer* observer) {
observers_.AddObserver(observer);
}

Powered by Google App Engine
This is Rietveld 408576698