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

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

Issue 1309063006: Fix vectorized icon for PPAPI broker website setting icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: docs Created 5 years, 3 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 | « chrome/browser/ui/content_settings/content_setting_image_model.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6adb4c504fa6b9be7123fa38953bd3535f906d71..7ecec73470fc99cc91229de9c2149c602352a3d8 100644
--- a/chrome/browser/ui/content_settings/content_setting_image_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_image_model.cc
@@ -34,6 +34,16 @@ bool UseVectorGraphics() {
#endif
}
+#if !defined(OS_MACOSX)
+// Gets a vector icon badged with |badge|.
+gfx::Image GetIcon(gfx::VectorIconId id, gfx::VectorIconId badge) {
+ SkColor icon_color;
+ ui::CommonThemeGetSystemColor(ui::NativeTheme::kColorId_ChromeIconGrey,
+ &icon_color);
+ return gfx::Image(gfx::CreateVectorIconWithBadge(id, 16, icon_color, badge));
+}
+#endif
+
} // namespace
class ContentSettingBlockedImageModel : public ContentSettingImageModel {
@@ -145,7 +155,6 @@ void ContentSettingBlockedImageModel::UpdateFromWebContents(
case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT:
vector_icon_id = gfx::VectorIconId::MIXED_CONTENT;
break;
- // TODO(estade): change this one?
case CONTENT_SETTINGS_TYPE_PPAPI_BROKER:
vector_icon_id = gfx::VectorIconId::EXTENSION;
break;
@@ -235,7 +244,13 @@ void ContentSettingBlockedImageModel::UpdateFromWebContents(
#if !defined(OS_MACOSX)
} else {
DCHECK(gfx::VectorIconId::VECTOR_ICON_NONE != vector_icon_id);
- SetIconByVectorId(vector_icon_id, content_settings->IsContentBlocked(type));
+
+ if (type == CONTENT_SETTINGS_TYPE_PPAPI_BROKER) {
+ set_icon(GetIcon(vector_icon_id, gfx::VectorIconId::WARNING_BADGE));
+ } else {
+ SetIconByVectorId(vector_icon_id,
+ content_settings->IsContentBlocked(type));
+ }
#endif
}
set_explanatory_string_id(explanation_id);
@@ -460,11 +475,7 @@ void ContentSettingImageModel::SetIconByResourceId(int id) {
#if !defined(OS_MACOSX)
void ContentSettingImageModel::SetIconByVectorId(gfx::VectorIconId id,
bool blocked) {
- SkColor icon_color;
- ui::CommonThemeGetSystemColor(ui::NativeTheme::kColorId_ChromeIconGrey,
- &icon_color);
- icon_ = gfx::Image(gfx::CreateVectorIconWithBadge(
- id, 16, icon_color, blocked ? gfx::VectorIconId::BLOCKED_BADGE
- : gfx::VectorIconId::VECTOR_ICON_NONE));
+ icon_ = GetIcon(id, blocked ? gfx::VectorIconId::BLOCKED_BADGE
+ : gfx::VectorIconId::VECTOR_ICON_NONE);
}
#endif
« no previous file with comments | « chrome/browser/ui/content_settings/content_setting_image_model.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698