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

Unified Diff: chrome/browser/ui/content_settings/content_setting_image_model.cc

Issue 11488009: Add content settings page action for Pepper broker authorization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 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/ui/content_settings/content_setting_image_model.cc
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 c81c2df7a9303d350677a997da3a683f380b0d59..b625e2e4d615b43c677fb6272807089d779dc075 100644
--- a/chrome/browser/ui/content_settings/content_setting_image_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_image_model.cc
@@ -89,6 +89,7 @@ void ContentSettingBlockedImageModel::UpdateFromWebContents(
{CONTENT_SETTINGS_TYPE_PLUGINS, IDR_BLOCKED_PLUGINS},
{CONTENT_SETTINGS_TYPE_POPUPS, IDR_BLOCKED_POPUPS},
{CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, IDR_BLOCKED_MIXED_CONTENT},
+ {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDR_BLOCKED_PPAPI_BROKER},
};
static const ContentSettingsTypeIdEntry kBlockedTooltipIDs[] = {
{CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_TITLE},
@@ -98,6 +99,7 @@ void ContentSettingBlockedImageModel::UpdateFromWebContents(
{CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_TOOLTIP},
{CONTENT_SETTINGS_TYPE_MIXEDSCRIPT,
IDS_BLOCKED_DISPLAYING_INSECURE_CONTENT},
+ {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_BLOCKED_PPAPI_BROKER_TITLE},
};
static const ContentSettingsTypeIdEntry kBlockedExplanatoryTextIDs[] = {
{CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_EXPLANATORY_TEXT},
@@ -120,16 +122,24 @@ void ContentSettingBlockedImageModel::UpdateFromWebContents(
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
if (!content_settings->IsContentBlocked(get_content_settings_type())) {
- if (!content_settings->IsContentAccessed(get_content_settings_type()) ||
+ if (!content_settings->IsContentAccessed(get_content_settings_type()))
+ return;
+
+ // For cookies, only show the accessed bubble if cookies are blocked by
+ // default.
+ if (get_content_settings_type() == CONTENT_SETTINGS_TYPE_COOKIES &&
(profile->GetHostContentSettingsMap()->
- GetDefaultContentSetting(get_content_settings_type(), NULL) !=
+ GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, NULL) !=
CONTENT_SETTING_BLOCK))
return;
+
static const ContentSettingsTypeIdEntry kAccessedIconIDs[] = {
{CONTENT_SETTINGS_TYPE_COOKIES, IDR_ACCESSED_COOKIES},
+ {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDR_BLOCKED_PPAPI_BROKER},
};
static const ContentSettingsTypeIdEntry kAccessedTooltipIDs[] = {
{CONTENT_SETTINGS_TYPE_COOKIES, IDS_ACCESSED_COOKIES_TITLE},
+ {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_ALLOWED_PPAPI_BROKER_TITLE},
};
icon_id = GetIdForContentType(
kAccessedIconIDs, arraysize(kAccessedIconIDs), type);
@@ -138,8 +148,10 @@ void ContentSettingBlockedImageModel::UpdateFromWebContents(
explanation_id = 0;
}
set_visible(true);
+ DCHECK(icon_id);
set_icon(icon_id);
set_explanatory_string_id(explanation_id);
+ DCHECK(tooltip_id);
set_tooltip(l10n_util::GetStringUTF8(tooltip_id));
}
« no previous file with comments | « chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc ('k') | chrome/chrome_nibs.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698