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

Unified Diff: chrome/browser/push_messaging/push_messaging_browsertest.cc

Issue 1690043004: Use GURLs instead of patterns in SetContentSetting() in geolocation and push_messaging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoping_set_content_setting
Patch Set: Created 4 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/push_messaging/push_messaging_browsertest.cc
diff --git a/chrome/browser/push_messaging/push_messaging_browsertest.cc b/chrome/browser/push_messaging/push_messaging_browsertest.cc
index 020c9a0516b8695cc62064f5926b497e41e6f8c0..5899e444f3c6b16813d58282b2374b7f7d8fc02d 100644
--- a/chrome/browser/push_messaging/push_messaging_browsertest.cc
+++ b/chrome/browser/push_messaging/push_messaging_browsertest.cc
@@ -870,10 +870,9 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
GURL origin = https_server()->GetURL("/").GetOrigin();
HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
- ->SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(origin),
- ContentSettingsPattern::FromURLNoWildcard(origin),
- CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, std::string(),
- CONTENT_SETTING_DEFAULT);
+ ->SetContentSettingDefaultScope(origin, origin,
+ CONTENT_SETTINGS_TYPE_PUSH_MESSAGING,
+ std::string(), CONTENT_SETTING_DEFAULT);
message_loop_runner->Run();
@@ -903,10 +902,9 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
GURL origin = https_server()->GetURL("/").GetOrigin();
HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
- ->SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(origin),
- ContentSettingsPattern::FromURLNoWildcard(origin),
- CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, std::string(),
- CONTENT_SETTING_BLOCK);
+ ->SetContentSettingDefaultScope(origin, origin,
+ CONTENT_SETTINGS_TYPE_PUSH_MESSAGING,
+ std::string(), CONTENT_SETTING_BLOCK);
message_loop_runner->Run();
@@ -965,10 +963,9 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
GURL origin = https_server()->GetURL("/").GetOrigin();
HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
- ->SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(origin),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string(),
- CONTENT_SETTING_DEFAULT);
+ ->SetContentSettingDefaultScope(origin, GURL(),
+ CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
+ std::string(), CONTENT_SETTING_DEFAULT);
message_loop_runner->Run();
@@ -998,10 +995,9 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
GURL origin = https_server()->GetURL("/").GetOrigin();
HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
- ->SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(origin),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string(),
- CONTENT_SETTING_BLOCK);
+ ->SetContentSettingDefaultScope(origin, GURL(),
+ CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
+ std::string(), CONTENT_SETTING_BLOCK);
message_loop_runner->Run();
@@ -1031,15 +1027,13 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
GURL origin = https_server()->GetURL("/").GetOrigin();
HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
- ->SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(origin),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string(),
- CONTENT_SETTING_ALLOW);
+ ->SetContentSettingDefaultScope(origin, GURL(),
+ CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
+ std::string(), CONTENT_SETTING_ALLOW);
HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
- ->SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(origin),
- ContentSettingsPattern::FromURLNoWildcard(origin),
- CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, std::string(),
- CONTENT_SETTING_ALLOW);
+ ->SetContentSettingDefaultScope(origin, origin,
+ CONTENT_SETTINGS_TYPE_PUSH_MESSAGING,
+ std::string(), CONTENT_SETTING_ALLOW);
message_loop_runner->Run();
@@ -1073,25 +1067,24 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
GURL origin = https_server()->GetURL("/").GetOrigin();
HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
- ->SetContentSetting(ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string(),
- CONTENT_SETTING_ALLOW);
+ ->SetContentSettingCustomScope(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
+ std::string(), CONTENT_SETTING_ALLOW);
HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
- ->SetContentSetting(ContentSettingsPattern::FromString("https://*"),
- ContentSettingsPattern::FromString("https://*"),
- CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, std::string(),
- CONTENT_SETTING_ALLOW);
+ ->SetContentSettingCustomScope(
+ ContentSettingsPattern::FromString("https://*"),
+ ContentSettingsPattern::FromString("https://*"),
+ CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, std::string(),
+ CONTENT_SETTING_ALLOW);
HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
- ->SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(origin),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string(),
- CONTENT_SETTING_DEFAULT);
+ ->SetContentSettingDefaultScope(origin, GURL(),
+ CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
+ std::string(), CONTENT_SETTING_DEFAULT);
HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
- ->SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(origin),
- ContentSettingsPattern::FromURLNoWildcard(origin),
- CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, std::string(),
- CONTENT_SETTING_DEFAULT);
+ ->SetContentSettingDefaultScope(origin, origin,
+ CONTENT_SETTINGS_TYPE_PUSH_MESSAGING,
+ std::string(), CONTENT_SETTING_DEFAULT);
message_loop_runner->Run();

Powered by Google App Engine
This is Rietveld 408576698