summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsramek <msramek@chromium.org>2015-12-18 09:42:47 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-18 17:43:56 +0000
commit5100baf1eac806abbdaaf8002887aacf652f34e5 (patch)
tree932bf59257e11ea2d0ad4f3cc7860dc3b4285ceb
parent43df859057abf1c500e6bc35a085340d663c4973 (diff)
downloadchromium_src-5100baf1eac806abbdaaf8002887aacf652f34e5.zip
chromium_src-5100baf1eac806abbdaaf8002887aacf652f34e5.tar.gz
chromium_src-5100baf1eac806abbdaaf8002887aacf652f34e5.tar.bz2
Remove the deprecated MEDIASTREAM content setting.
The MEDIASTREAM content setting, representing a combined permission for microphone and camera, had by now been replaced with two separate MEDIASTREAM_MIC and MEDIASTREAM_CAMERA settings. The remaining occurrences are just various DCHECKs and early exits. In this CL, we remove all occurrences of CONTENT_SETTINGS_TYPE_MEDIASTREAM. Furthermore, we add a cleanup code to DefaultProvider and PrefProvider in order to clean up any traces of the permission in the Preference file (although this is unlikely, since the permission has been disused for quite some time). BUG=443799 Review URL: https://codereview.chromium.org/1536633002 Cr-Commit-Position: refs/heads/master@{#366119}
-rw-r--r--chrome/browser/content_settings/tab_specific_content_settings.cc7
-rw-r--r--chrome/browser/profile_resetter/profile_resetter_unittest.cc5
-rw-r--r--chrome/browser/ui/browser_content_setting_bubble_model_delegate.cc2
-rw-r--r--chrome/browser/ui/content_settings/content_setting_bubble_model.cc2
-rw-r--r--chrome/browser/ui/content_settings/content_setting_image_model.cc7
-rw-r--r--chrome/browser/ui/website_settings/permission_menu_model.cc3
-rw-r--r--chrome/browser/ui/webui/options/content_settings_handler.cc6
-rw-r--r--components/content_settings/core/browser/content_settings_default_provider.cc8
-rw-r--r--components/content_settings/core/browser/content_settings_pref_provider.cc6
-rw-r--r--components/content_settings/core/browser/content_settings_registry.cc7
-rw-r--r--components/content_settings/core/browser/host_content_settings_map.cc4
-rw-r--r--components/content_settings/core/common/content_settings.cc1
-rw-r--r--components/content_settings/core/common/content_settings_types.h1
13 files changed, 15 insertions, 44 deletions
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index 4f57808..8adbab2 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -239,9 +239,6 @@ bool TabSpecificContentSettings::IsContentBlocked(
DCHECK_NE(CONTENT_SETTINGS_TYPE_NOTIFICATIONS, content_type)
<< "Notifications settings handled by "
<< "ContentSettingsNotificationsImageModel";
- DCHECK_NE(CONTENT_SETTINGS_TYPE_MEDIASTREAM, content_type)
- << "The Mediastream content setting is deprecated. "
- << "Call IsContentBlocked for camera and microphone settings instead.";
if (content_type == CONTENT_SETTINGS_TYPE_IMAGES ||
content_type == CONTENT_SETTINGS_TYPE_JAVASCRIPT ||
@@ -279,9 +276,8 @@ void TabSpecificContentSettings::SetBlockageHasBeenIndicated(
bool TabSpecificContentSettings::IsContentAllowed(
ContentSettingsType content_type) const {
// This method currently only returns meaningful values for the content type
- // cookies, mediastream, PPAPI broker, and downloads.
+ // cookies, media, PPAPI broker, downloads, and MIDI sysex.
if (content_type != CONTENT_SETTINGS_TYPE_COOKIES &&
- content_type != CONTENT_SETTINGS_TYPE_MEDIASTREAM &&
content_type != CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC &&
content_type != CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA &&
content_type != CONTENT_SETTINGS_TYPE_PPAPI_BROKER &&
@@ -835,7 +831,6 @@ void TabSpecificContentSettings::BlockAllContentForTesting() {
for (const content_settings::ContentSettingsInfo* info : *registry) {
ContentSettingsType type = info->website_settings_info()->type();
if (type != CONTENT_SETTINGS_TYPE_GEOLOCATION &&
- type != CONTENT_SETTINGS_TYPE_MEDIASTREAM &&
type != CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC &&
type != CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) {
OnContentBlocked(type);
diff --git a/chrome/browser/profile_resetter/profile_resetter_unittest.cc b/chrome/browser/profile_resetter/profile_resetter_unittest.cc
index 5c6085d..1378743 100644
--- a/chrome/browser/profile_resetter/profile_resetter_unittest.cc
+++ b/chrome/browser/profile_resetter/profile_resetter_unittest.cc
@@ -503,10 +503,6 @@ TEST_F(ProfileResetterTest, ResetContentSettings) {
// GetDefaultContentSetting() for them.
continue;
}
- if (content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) {
- // This has been deprecated so we can neither set nor get it's value.
- continue;
- }
ContentSetting default_setting =
host_content_settings_map->GetDefaultContentSetting(content_type, NULL);
default_settings[content_type] = default_setting;
@@ -536,7 +532,6 @@ TEST_F(ProfileResetterTest, ResetContentSettings) {
for (const content_settings::ContentSettingsInfo* info : *registry) {
ContentSettingsType content_type = info->website_settings_info()->type();
if (content_type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT ||
- content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM ||
content_type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS)
continue;
ContentSetting default_setting =
diff --git a/chrome/browser/ui/browser_content_setting_bubble_model_delegate.cc b/chrome/browser/ui/browser_content_setting_bubble_model_delegate.cc
index 7e15301..aa1df7f 100644
--- a/chrome/browser/ui/browser_content_setting_bubble_model_delegate.cc
+++ b/chrome/browser/ui/browser_content_setting_bubble_model_delegate.cc
@@ -49,8 +49,6 @@ void BrowserContentSettingBubbleModelDelegate::ShowContentSettingsPage(
ui::PAGE_TRANSITION_LINK);
} else if (type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS) {
chrome::ShowSettingsSubPage(browser_, chrome::kHandlerSettingsSubPage);
- } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) {
- NOTREACHED() << "The MEDIASTREAM setting is deprecated.";
} else {
chrome::ShowContentSettingsExceptions(browser_, type);
}
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
index 5964f0e..83e947a 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -124,8 +124,6 @@ void ContentSettingSimpleBubbleModel::SetTitle() {
TabSpecificContentSettings::FromWebContents(web_contents());
}
- DCHECK_NE(CONTENT_SETTINGS_TYPE_MEDIASTREAM, content_type());
-
static const ContentSettingsTypeIdEntry kBlockedTitleIDs[] = {
{CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_TITLE},
{CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_TITLE},
diff --git a/chrome/browser/ui/content_settings/content_setting_image_model.cc b/chrome/browser/ui/content_settings/content_setting_image_model.cc
index 56d5221..d4e1ed3 100644
--- a/chrome/browser/ui/content_settings/content_setting_image_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_image_model.cc
@@ -235,13 +235,6 @@ scoped_ptr<ContentSettingImageModel>
if (content_settings_type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS)
return make_scoped_ptr(new ContentSettingRPHImageModel());
- if (content_settings_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) {
- NOTREACHED() << "The mediastream content setting is deprecated. "
- << "Media image model that used to be tied to this setting "
- << "can no longer be created by this function.";
- return nullptr;
- }
-
if (content_settings_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX)
return make_scoped_ptr(new ContentSettingMIDISysExImageModel());
diff --git a/chrome/browser/ui/website_settings/permission_menu_model.cc b/chrome/browser/ui/website_settings/permission_menu_model.cc
index 96ea88d..9f63ee5 100644
--- a/chrome/browser/ui/website_settings/permission_menu_model.cc
+++ b/chrome/browser/ui/website_settings/permission_menu_model.cc
@@ -58,9 +58,6 @@ PermissionMenuModel::PermissionMenuModel(
permission_.type == CONTENT_SETTINGS_TYPE_MOUSELOCK) &&
url.SchemeIsFile();
- // The deprecated MEDIASTREAM setting is no longer used to represent media.
- DCHECK_NE(CONTENT_SETTINGS_TYPE_MEDIASTREAM, permission_.type);
-
// Media only supports CONTENT_SETTTING_ALLOW for secure origins.
bool is_media_permission =
permission_.type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC ||
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index a40215c..278f493 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -1552,9 +1552,6 @@ void ContentSettingsHandler::SetContentFilter(const base::ListValue* args) {
HostContentSettingsMap* map =
HostContentSettingsMapFactory::GetForProfile(profile);
-
- // The MEDIASTREAM setting is deprecated and has no UI.
- DCHECK_NE(CONTENT_SETTINGS_TYPE_MEDIASTREAM, content_type);
map->SetDefaultContentSetting(content_type, default_setting);
const ExceptionsInfoMap& exceptions_info_map = GetExceptionsInfoMap();
@@ -1601,9 +1598,6 @@ void ContentSettingsHandler::SetException(const base::ListValue* args) {
ContentSettingsType type = ContentSettingsTypeFromGroupName(type_string);
- // The MEDIASTREAM setting is deprecated and has no UI.
- DCHECK_NE(CONTENT_SETTINGS_TYPE_MEDIASTREAM, type);
-
if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION ||
type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC ||
type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) {
diff --git a/components/content_settings/core/browser/content_settings_default_provider.cc b/components/content_settings/core/browser/content_settings_default_provider.cc
index 381f43a..90a0e9f 100644
--- a/components/content_settings/core/browser/content_settings_default_provider.cc
+++ b/components/content_settings/core/browser/content_settings_default_provider.cc
@@ -34,6 +34,10 @@ namespace {
const char kObsoleteMetroSwitchToDesktopSetting[] =
"profile.default_content_setting_values.metro_switch_to_desktop";
+// TODO(msramek): Remove this cleanup code after two releases (i.e. in M51).
+const char kObsoleteMediaStreamSetting[] =
+ "profile.default_content_setting_values.media_stream";
+
ContentSetting GetDefaultValue(const WebsiteSettingsInfo* info) {
const base::Value* initial_default = info->initial_default_value();
if (!initial_default)
@@ -95,6 +99,9 @@ void DefaultProvider::RegisterProfilePrefs(
kObsoleteMetroSwitchToDesktopSetting,
0,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+
+ // The removed content settings type MEDIASTREAM.
+ registry->RegisterIntegerPref(kObsoleteMediaStreamSetting, 0);
}
DefaultProvider::DefaultProvider(PrefService* prefs, bool incognito)
@@ -350,6 +357,7 @@ scoped_ptr<base::Value> DefaultProvider::ReadFromPref(
void DefaultProvider::DiscardObsoletePreferences() {
prefs_->ClearPref(kObsoleteMetroSwitchToDesktopSetting);
+ prefs_->ClearPref(kObsoleteMediaStreamSetting);
}
} // namespace content_settings
diff --git a/components/content_settings/core/browser/content_settings_pref_provider.cc b/components/content_settings/core/browser/content_settings_pref_provider.cc
index b43e83e..159395e 100644
--- a/components/content_settings/core/browser/content_settings_pref_provider.cc
+++ b/components/content_settings/core/browser/content_settings_pref_provider.cc
@@ -36,6 +36,9 @@ namespace {
const char kObsoleteMetroSwitchToDesktopExceptions[] =
"profile.content_settings.exceptions.metro_switch_to_desktop";
+const char kObsoleteMediaStreamExceptions[] =
+ "profile.content_settings.exceptions.media_stream";
+
} // namespace
namespace content_settings {
@@ -63,6 +66,8 @@ void PrefProvider::RegisterProfilePrefs(
registry->RegisterDictionaryPref(
kObsoleteMetroSwitchToDesktopExceptions,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+
+ registry->RegisterDictionaryPref(kObsoleteMediaStreamExceptions);
}
PrefProvider::PrefProvider(PrefService* prefs, bool incognito)
@@ -196,6 +201,7 @@ void PrefProvider::Notify(
void PrefProvider::DiscardObsoletePreferences() {
prefs_->ClearPref(kObsoleteMetroSwitchToDesktopExceptions);
+ prefs_->ClearPref(kObsoleteMediaStreamExceptions);
}
} // namespace content_settings
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
index a7c1d09..3b0d1e2 100644
--- a/components/content_settings/core/browser/content_settings_registry.cc
+++ b/components/content_settings/core/browser/content_settings_registry.cc
@@ -273,13 +273,6 @@ void ContentSettingsRegistry::Init() {
WhitelistedSchemes(), ValidSettings(),
WebsiteSettingsInfo::TOP_LEVEL_DOMAIN_ONLY_SCOPE,
ContentSettingsInfo::INHERIT_IN_INCOGNITO);
-
- // Deprecated.
- Register(CONTENT_SETTINGS_TYPE_MEDIASTREAM, "media-stream",
- CONTENT_SETTING_DEFAULT, WebsiteSettingsInfo::UNSYNCABLE,
- WhitelistedSchemes(), ValidSettings(),
- WebsiteSettingsInfo::TOP_LEVEL_DOMAIN_ONLY_SCOPE,
- ContentSettingsInfo::INHERIT_IN_INCOGNITO);
}
void ContentSettingsRegistry::Register(
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 2f2b7cf..af75817 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -662,10 +662,6 @@ scoped_ptr<base::Value> HostContentSettingsMap::GetWebsiteSettingInternal(
ContentSettingsType content_type,
const std::string& resource_identifier,
content_settings::SettingInfo* info) const {
- // TODO(msramek): MEDIASTREAM is deprecated. Remove this check when all
- // references to MEDIASTREAM are removed from the code.
- DCHECK_NE(CONTENT_SETTINGS_TYPE_MEDIASTREAM, content_type);
-
UsedContentSettingsProviders();
ContentSettingsPattern* primary_pattern = NULL;
ContentSettingsPattern* secondary_pattern = NULL;
diff --git a/components/content_settings/core/common/content_settings.cc b/components/content_settings/core/common/content_settings.cc
index c22d7646..a0860d5 100644
--- a/components/content_settings/core/common/content_settings.cc
+++ b/components/content_settings/core/common/content_settings.cc
@@ -33,7 +33,6 @@ ContentSettingsType kHistogramOrder[] = {
CONTENT_SETTINGS_TYPE_FULLSCREEN,
CONTENT_SETTINGS_TYPE_MOUSELOCK,
CONTENT_SETTINGS_TYPE_MIXEDSCRIPT,
- CONTENT_SETTINGS_TYPE_MEDIASTREAM,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS,
diff --git a/components/content_settings/core/common/content_settings_types.h b/components/content_settings/core/common/content_settings_types.h
index 6225c1e..02c389e 100644
--- a/components/content_settings/core/common/content_settings_types.h
+++ b/components/content_settings/core/common/content_settings_types.h
@@ -29,7 +29,6 @@ enum ContentSettingsType {
CONTENT_SETTINGS_TYPE_FULLSCREEN,
CONTENT_SETTINGS_TYPE_MOUSELOCK,
CONTENT_SETTINGS_TYPE_MIXEDSCRIPT,
- CONTENT_SETTINGS_TYPE_MEDIASTREAM, // Deprecated.
CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS,