| 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
|
|
|