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

Unified Diff: chrome/browser/banners/app_banner_settings_helper.cc

Issue 919843003: Clear app banner data when history is cleared. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/banners/app_banner_settings_helper.cc
diff --git a/chrome/browser/banners/app_banner_settings_helper.cc b/chrome/browser/banners/app_banner_settings_helper.cc
index 1847f506e39c27df9660e4ce65995698849d5ad4..2568ca1d326a04611d2ed361ab4251712b2e82c4 100644
--- a/chrome/browser/banners/app_banner_settings_helper.cc
+++ b/chrome/browser/banners/app_banner_settings_helper.cc
@@ -79,6 +79,21 @@ base::DictionaryValue* GetAppDict(base::DictionaryValue* origin_dict,
} // namespace
+void AppBannerSettingsHelper::ClearHistoryForURLs(
+ Profile* profile,
+ const std::set<GURL>& origin_urls) {
+ HostContentSettingsMap* settings = profile->GetHostContentSettingsMap();
+ for (const auto& origin_url : origin_urls) {
Bernhard Bauer 2015/02/13 10:05:06 Using GURL instead of auto here is clearer, and no
benwells 2015/02/15 22:56:05 Done.
+ ContentSettingsPattern pattern(ContentSettingsPattern::FromURL(origin_url));
+ if (!pattern.IsValid())
+ continue;
+
+ settings->SetWebsiteSetting(pattern, ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_APP_BANNER, std::string(),
+ nullptr);
+ }
+}
+
void AppBannerSettingsHelper::RecordBannerEvent(
content::WebContents* web_contents,
const GURL& origin_url,

Powered by Google App Engine
This is Rietveld 408576698