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

Unified Diff: chrome/browser/content_settings/tab_specific_content_settings.cc

Issue 13375004: Fixed the problem that cookie blocking notification bubble is not displayed in the omnibox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed the comment Created 7 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/content_settings/tab_specific_content_settings_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a9ac352d4f102f8651033651023c63387e7575d2 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,9 +309,13 @@ 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 (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;
+ }
}
if (!content_allowed_[type]) {
« no previous file with comments | « no previous file | chrome/browser/content_settings/tab_specific_content_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698