Chromium Code Reviews| Index: chrome/browser/content_settings/tab_specific_content_settings.cc |
| diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc |
| index 74a7ea924c2f4c4d85950deec33b31d3c61f3c5d..8254f7e07dcec60e6e813187289ffd0014f32228 100644 |
| --- a/chrome/browser/content_settings/tab_specific_content_settings.cc |
| +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc |
| @@ -264,7 +264,13 @@ void TabSpecificContentSettings::OnContentBlocked( |
| if (type < 0 || type >= CONTENT_SETTINGS_NUM_TYPES) |
| return; |
| - content_allowed_[type] = false; |
| + // Media is different from other content setting types since it allows new |
| + // setting to kick in without reloading the page, and the UI for media is |
| + // always reflecting the newest permission setting. |
| + if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) |
| + content_allowed_[type] = false; |
| + else |
| + content_allowed_[type] = true; |
| // Unless UI for resource content settings is enabled, ignore the resource |
| // identifier. |
| @@ -303,14 +309,23 @@ void TabSpecificContentSettings::OnContentAllowed(ContentSettingsType type) { |
| DCHECK(type != CONTENT_SETTINGS_TYPE_GEOLOCATION) |
| << "Geolocation settings handled by OnGeolocationPermissionSet"; |
| bool access_changed = false; |
| - if (content_blocked_[type]) { |
| - content_blocked_[type] = false; |
| - access_changed = true; |
| - } |
| - |
| - if (!content_allowed_[type]) { |
| - content_allowed_[type] = true; |
| - access_changed = true; |
| + if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) { |
| + // The setting for media is overwritten here because media does not need to |
| + // reload the page to have the new setting kick in. See issue/175993. |
| + if (content_blocked_[type]) { |
| + content_blocked_[type] = false; |
| + access_changed = true; |
| + } |
|
jochen (gone - plz use gerrit)
2013/04/02 13:08:53
nit, you can just close the if block here, no need
no longer working on chromium
2013/04/02 14:12:06
Done.
|
| + |
| + if (!content_allowed_[type]) { |
| + content_allowed_[type] = true; |
| + access_changed = true; |
| + } |
| + } else { |
| + if (!content_allowed_[type]) { |
| + content_allowed_[type] = true; |
| + access_changed = true; |
| + } |
| } |
| if (access_changed) { |