Commit 0418c344 authored by thestig's avatar thestig Committed by Commit bot

Cleanup nits in content_setting*model.

Review-Url: https://codereview.chromium.org/2371083002
Cr-Commit-Position: refs/heads/master@{#421217}
parent f40a0349
...@@ -104,47 +104,24 @@ struct ContentSettingsImageDetails { ...@@ -104,47 +104,24 @@ struct ContentSettingsImageDetails {
int accessed_tooltip_id; int accessed_tooltip_id;
}; };
static const ContentSettingsImageDetails kImageDetails[] = { const ContentSettingsImageDetails kImageDetails[] = {
{CONTENT_SETTINGS_TYPE_COOKIES, {CONTENT_SETTINGS_TYPE_COOKIES, gfx::VectorIconId::COOKIE,
gfx::VectorIconId::COOKIE, IDS_BLOCKED_COOKIES_TITLE, 0, IDS_ACCESSED_COOKIES_TITLE},
IDS_BLOCKED_COOKIES_TITLE, {CONTENT_SETTINGS_TYPE_IMAGES, gfx::VectorIconId::IMAGE,
0, IDS_BLOCKED_IMAGES_TITLE, 0, 0},
IDS_ACCESSED_COOKIES_TITLE}, {CONTENT_SETTINGS_TYPE_JAVASCRIPT, gfx::VectorIconId::CODE,
{CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_JAVASCRIPT_TITLE, 0, 0},
gfx::VectorIconId::IMAGE, {CONTENT_SETTINGS_TYPE_PLUGINS, gfx::VectorIconId::EXTENSION,
IDS_BLOCKED_IMAGES_TITLE, IDS_BLOCKED_PLUGINS_MESSAGE, IDS_BLOCKED_PLUGIN_EXPLANATORY_TEXT, 0},
0, {CONTENT_SETTINGS_TYPE_POPUPS, gfx::VectorIconId::WEB,
0}, IDS_BLOCKED_POPUPS_TOOLTIP, IDS_BLOCKED_POPUPS_EXPLANATORY_TEXT, 0},
{CONTENT_SETTINGS_TYPE_JAVASCRIPT, {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, gfx::VectorIconId::MIXED_CONTENT,
gfx::VectorIconId::CODE, IDS_BLOCKED_DISPLAYING_INSECURE_CONTENT, 0, 0},
IDS_BLOCKED_JAVASCRIPT_TITLE, {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, gfx::VectorIconId::EXTENSION,
0, IDS_BLOCKED_PPAPI_BROKER_TITLE, 0, IDS_ALLOWED_PPAPI_BROKER_TITLE},
0},
{CONTENT_SETTINGS_TYPE_PLUGINS,
gfx::VectorIconId::EXTENSION,
IDS_BLOCKED_PLUGINS_MESSAGE,
IDS_BLOCKED_PLUGIN_EXPLANATORY_TEXT,
0},
{CONTENT_SETTINGS_TYPE_POPUPS,
gfx::VectorIconId::WEB,
IDS_BLOCKED_POPUPS_TOOLTIP,
IDS_BLOCKED_POPUPS_EXPLANATORY_TEXT,
0},
{CONTENT_SETTINGS_TYPE_MIXEDSCRIPT,
gfx::VectorIconId::MIXED_CONTENT,
IDS_BLOCKED_DISPLAYING_INSECURE_CONTENT,
0,
0},
{CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
gfx::VectorIconId::EXTENSION,
IDS_BLOCKED_PPAPI_BROKER_TITLE,
0,
IDS_ALLOWED_PPAPI_BROKER_TITLE},
{CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS,
gfx::VectorIconId::FILE_DOWNLOAD, gfx::VectorIconId::FILE_DOWNLOAD, IDS_BLOCKED_DOWNLOAD_TITLE,
IDS_BLOCKED_DOWNLOAD_TITLE, IDS_BLOCKED_DOWNLOADS_EXPLANATION, IDS_ALLOWED_DOWNLOAD_TITLE},
IDS_BLOCKED_DOWNLOADS_EXPLANATION,
IDS_ALLOWED_DOWNLOAD_TITLE},
}; };
const ContentSettingsImageDetails* GetImageDetails(ContentSettingsType type) { const ContentSettingsImageDetails* GetImageDetails(ContentSettingsType type) {
...@@ -263,7 +240,7 @@ void ContentSettingBlockedImageModel::UpdateFromWebContents( ...@@ -263,7 +240,7 @@ void ContentSettingBlockedImageModel::UpdateFromWebContents(
// For cookies, only show the cookie blocked page action if cookies are // For cookies, only show the cookie blocked page action if cookies are
// blocked by default. // blocked by default.
if (type == CONTENT_SETTINGS_TYPE_COOKIES && if (type == CONTENT_SETTINGS_TYPE_COOKIES &&
(map->GetDefaultContentSetting(type, NULL) != CONTENT_SETTING_BLOCK)) (map->GetDefaultContentSetting(type, nullptr) != CONTENT_SETTING_BLOCK))
return; return;
tooltip_id = image_details->accessed_tooltip_id; tooltip_id = image_details->accessed_tooltip_id;
...@@ -306,7 +283,7 @@ void ContentSettingGeolocationImageModel::UpdateFromWebContents( ...@@ -306,7 +283,7 @@ void ContentSettingGeolocationImageModel::UpdateFromWebContents(
// If any embedded site has access the allowed icon takes priority over the // If any embedded site has access the allowed icon takes priority over the
// blocked icon. // blocked icon.
unsigned int state_flags = 0; unsigned int state_flags = 0;
usages_state.GetDetailedInfo(NULL, &state_flags); usages_state.GetDetailedInfo(nullptr, &state_flags);
bool allowed = bool allowed =
!!(state_flags & ContentSettingsUsagesState::TABSTATE_HAS_ANY_ALLOWED); !!(state_flags & ContentSettingsUsagesState::TABSTATE_HAS_ANY_ALLOWED);
set_icon_by_vector_id(gfx::VectorIconId::MY_LOCATION, set_icon_by_vector_id(gfx::VectorIconId::MY_LOCATION,
...@@ -504,7 +481,7 @@ void ContentSettingMIDISysExImageModel::UpdateFromWebContents( ...@@ -504,7 +481,7 @@ void ContentSettingMIDISysExImageModel::UpdateFromWebContents(
// If any embedded site has access the allowed icon takes priority over the // If any embedded site has access the allowed icon takes priority over the
// blocked icon. // blocked icon.
unsigned int state_flags = 0; unsigned int state_flags = 0;
usages_state.GetDetailedInfo(NULL, &state_flags); usages_state.GetDetailedInfo(nullptr, &state_flags);
bool allowed = bool allowed =
!!(state_flags & ContentSettingsUsagesState::TABSTATE_HAS_ANY_ALLOWED); !!(state_flags & ContentSettingsUsagesState::TABSTATE_HAS_ANY_ALLOWED);
set_icon_by_vector_id(gfx::VectorIconId::MIDI, set_icon_by_vector_id(gfx::VectorIconId::MIDI,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment