Commit d29f30d2 authored by Bret Sepulveda's avatar Bret Sepulveda Committed by Commit Bot

Harmonize plugins blocked bubble.

Since Flash is now the only supported plugin, this patch removes all the
generic language in the dialog and makes it specific to Flash. This
patch also deletes some related strings that were unused.

Bug: 652030
Change-Id: Iadd4eb43305f269456c59a06132c9d9c2184c6e3
Reviewed-on: https://chromium-review.googlesource.com/685806Reviewed-by: default avatarAdrienne Porter Felt <felt@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarRaymes Khoury <raymes@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505888}
parent 85232302
...@@ -2254,28 +2254,14 @@ From <ph name="DOWNLOAD_DOMAIN">$3<ex>example.com</ex></ph> ...@@ -2254,28 +2254,14 @@ From <ph name="DOWNLOAD_DOMAIN">$3<ex>example.com</ex></ph>
<message name="IDS_BLOCKED_JAVASCRIPT_LINK" desc="Link to JavaScript section of content blocking management dialog, displayed in bubble when a page tries to run JavaScript."> <message name="IDS_BLOCKED_JAVASCRIPT_LINK" desc="Link to JavaScript section of content blocking management dialog, displayed in bubble when a page tries to run JavaScript.">
Manage JavaScript blocking... Manage JavaScript blocking...
</message> </message>
<message name="IDS_BLOCKED_PLUGINS_TITLE" desc="Bubble info header text when a page is not allowed to display plugins."> <message name="IDS_BLOCKED_PLUGINS_TITLE" desc="Bubble info header text when a page is not allowed to run Flash.">
The following plugins were blocked on this page: Flash was blocked on this page
</message> </message>
<message name="IDS_BLOCKED_PLUGINS_MESSAGE" desc="Tooltip and message when a page is not allowed to display plugins."> <message name="IDS_BLOCKED_PLUGINS_MESSAGE" desc="Tooltip on the icon when a page is not allowed to run Flash.">
Plugins were blocked on this page. Flash was blocked on this page.
</message>
<message name="IDS_BLOCKED_PLUGINS_UNBLOCK_ALL" desc="Radio button choice to unblock a site from using plugins, displayed in bubble when a page tries to use plugins.">
Always allow plugins on <ph name="HOST">$1<ex>mail.google.com</ex></ph>
</message>
<if expr="is_macosx">
<message name="IDS_BLOCKED_PLUGINS_UNBLOCK" desc="Radio button choice to unblock a site from using *a specific set* of plugins, displayed in bubble when a page tries to use plugins.">
Always allow these plugins on <ph name="HOST">$1<ex>mail.google.com</ex></ph>
</message>
</if>
<message name="IDS_BLOCKED_PLUGINS_NO_ACTION" desc="Radio button choice to continue blocking a site from using plugins, displayed in bubble when a page tries to use plugins.">
Continue blocking plugins
</message>
<message name="IDS_BLOCKED_PLUGINS_LINK" desc="Link to plugins section of content blocking management dialog, displayed in bubble when a page tries to display plugins.">
Manage plugin blocking...
</message> </message>
<message name="IDS_BLOCKED_PLUGINS_LOAD_ALL" desc="Button to load all blocked plugins on a page, displayed in bubble when a page tries to display plugins."> <message name="IDS_BLOCKED_PLUGINS_LOAD_ALL" desc="Button to load all blocked plugins on a page, displayed in bubble when a page tries to display plugins.">
Run all plugins this time Run Flash this time
</message> </message>
<!-- Win certificate selector dialog strings. --> <!-- Win certificate selector dialog strings. -->
......
...@@ -331,11 +331,6 @@ void TabSpecificContentSettings::OnContentBlockedWithDetail( ...@@ -331,11 +331,6 @@ void TabSpecificContentSettings::OnContentBlockedWithDetail(
} }
#endif #endif
if (type == CONTENT_SETTINGS_TYPE_PLUGINS && !details.empty() &&
!base::ContainsValue(blocked_plugin_names_, details)) {
blocked_plugin_names_.push_back(details);
}
if (!status.blocked) { if (!status.blocked) {
status.blocked = true; status.blocked = true;
// TODO: it would be nice to have a way of mocking this in tests. // TODO: it would be nice to have a way of mocking this in tests.
...@@ -806,7 +801,6 @@ void TabSpecificContentSettings::DidFinishNavigation( ...@@ -806,7 +801,6 @@ void TabSpecificContentSettings::DidFinishNavigation(
// Clear "blocked" flags. // Clear "blocked" flags.
ClearContentSettingsExceptForNavigationRelatedSettings(); ClearContentSettingsExceptForNavigationRelatedSettings();
blocked_plugin_names_.clear();
GeolocationDidNavigate(navigation_handle); GeolocationDidNavigate(navigation_handle);
MidiDidNavigate(navigation_handle); MidiDidNavigate(navigation_handle);
......
...@@ -201,11 +201,6 @@ class TabSpecificContentSettings ...@@ -201,11 +201,6 @@ class TabSpecificContentSettings
// only tracks cookies. // only tracks cookies.
bool IsContentAllowed(ContentSettingsType content_type) const; bool IsContentAllowed(ContentSettingsType content_type) const;
// Returns the names of plugins that have been blocked for this tab.
const std::vector<base::string16>& blocked_plugin_names() const {
return blocked_plugin_names_;
}
const GURL& media_stream_access_origin() const { const GURL& media_stream_access_origin() const {
return media_stream_access_origin_; return media_stream_access_origin_;
} }
...@@ -440,9 +435,6 @@ class TabSpecificContentSettings ...@@ -440,9 +435,6 @@ class TabSpecificContentSettings
// the user opens the bubble and makes changes multiple times. // the user opens the bubble and makes changes multiple times.
ContentSetting pending_protocol_handler_setting_; ContentSetting pending_protocol_handler_setting_;
// The name(s) of the plugin(s) being blocked.
std::vector<base::string16> blocked_plugin_names_;
// Stores whether the user can load blocked plugins on this page. // Stores whether the user can load blocked plugins on this page.
bool load_plugins_link_enabled_; bool load_plugins_link_enabled_;
......
...@@ -279,7 +279,6 @@ void ContentSettingSingleRadioGroup::SetRadioGroup() { ...@@ -279,7 +279,6 @@ void ContentSettingSingleRadioGroup::SetRadioGroup() {
{CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_UNBLOCK}, {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_UNBLOCK},
{CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_UNBLOCK}, {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_UNBLOCK},
{CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_UNBLOCK}, {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_UNBLOCK},
{CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_UNBLOCK_ALL},
{CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_UNBLOCK}, {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_UNBLOCK},
{CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_BLOCKED_PPAPI_BROKER_UNBLOCK}, {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_BLOCKED_PPAPI_BROKER_UNBLOCK},
}; };
...@@ -306,7 +305,6 @@ void ContentSettingSingleRadioGroup::SetRadioGroup() { ...@@ -306,7 +305,6 @@ void ContentSettingSingleRadioGroup::SetRadioGroup() {
{CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_NO_ACTION}, {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_NO_ACTION},
{CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_NO_ACTION}, {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_NO_ACTION},
{CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_NO_ACTION}, {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_NO_ACTION},
{CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_NO_ACTION},
{CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_NO_ACTION}, {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_NO_ACTION},
{CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_BLOCKED_PPAPI_BROKER_NO_ACTION}, {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_BLOCKED_PPAPI_BROKER_NO_ACTION},
}; };
...@@ -478,22 +476,6 @@ ContentSettingPluginBubbleModel::ContentSettingPluginBubbleModel( ...@@ -478,22 +476,6 @@ ContentSettingPluginBubbleModel::ContentSettingPluginBubbleModel(
->load_plugins_link_enabled()); ->load_plugins_link_enabled());
} }
// Build blocked plugin list.
if (web_contents) {
TabSpecificContentSettings* content_settings =
TabSpecificContentSettings::FromWebContents(web_contents);
const std::vector<base::string16>& blocked_plugins =
content_settings->blocked_plugin_names();
for (const base::string16& blocked_plugin : blocked_plugins) {
ListItem plugin_item(
ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_BLOCKED_PLUGINS),
blocked_plugin, false, 0);
AddListItem(plugin_item);
}
}
set_show_learn_more(true); set_show_learn_more(true);
content_settings::RecordPluginsAction( content_settings::RecordPluginsAction(
......
...@@ -729,8 +729,7 @@ TEST_F(ContentSettingBubbleModelTest, Plugins) { ...@@ -729,8 +729,7 @@ TEST_F(ContentSettingBubbleModelTest, Plugins) {
const ContentSettingBubbleModel::BubbleContent& bubble_content = const ContentSettingBubbleModel::BubbleContent& bubble_content =
content_setting_bubble_model->bubble_content(); content_setting_bubble_model->bubble_content();
EXPECT_FALSE(bubble_content.title.empty()); EXPECT_FALSE(bubble_content.title.empty());
ASSERT_EQ(1U, bubble_content.list_items.size()); ASSERT_EQ(0U, bubble_content.list_items.size());
EXPECT_EQ(plugin_name, bubble_content.list_items[0].title);
EXPECT_EQ(0U, bubble_content.radio_group.radio_items.size()); EXPECT_EQ(0U, bubble_content.radio_group.radio_items.size());
EXPECT_FALSE(bubble_content.custom_link.empty()); EXPECT_FALSE(bubble_content.custom_link.empty());
EXPECT_TRUE(bubble_content.custom_link_enabled); EXPECT_TRUE(bubble_content.custom_link_enabled);
......
...@@ -384,16 +384,6 @@ void ContentSettingBubbleContents::Init() { ...@@ -384,16 +384,6 @@ void ContentSettingBubbleContents::Init() {
content_setting_bubble_model_->bubble_content(); content_setting_bubble_model_->bubble_content();
bool bubble_content_empty = true; bool bubble_content_empty = true;
if (!provider->IsHarmonyMode() && !bubble_content.title.empty()) {
views::Label* title_label =
new views::Label(bubble_content.title, CONTEXT_BODY_TEXT_SMALL);
title_label->SetMultiLine(true);
title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
layout->StartRow(0, kSingleColumnSetId);
layout->AddView(title_label);
bubble_content_empty = false;
}
if (!bubble_content.message.empty()) { if (!bubble_content.message.empty()) {
views::Label* message_label = new views::Label(bubble_content.message); views::Label* message_label = new views::Label(bubble_content.message);
// For bubble's without titles there is no need for padding. // For bubble's without titles there is no need for padding.
...@@ -534,14 +524,6 @@ void ContentSettingBubbleContents::Init() { ...@@ -534,14 +524,6 @@ void ContentSettingBubbleContents::Init() {
layout->AddView(manage_checkbox_); layout->AddView(manage_checkbox_);
} }
if (!bubble_content_empty && !provider->IsHarmonyMode()) {
layout->AddPaddingRow(0, related_control_vertical_spacing);
layout->StartRow(0, kSingleColumnSetId);
layout->AddView(new views::Separator(), 1, 1, GridLayout::FILL,
GridLayout::FILL);
layout->AddPaddingRow(0, related_control_vertical_spacing);
}
if (list_item_container_) if (list_item_container_)
content_setting_bubble_model_->set_owner(this); content_setting_bubble_model_->set_owner(this);
} }
...@@ -550,6 +532,15 @@ views::View* ContentSettingBubbleContents::CreateExtraView() { ...@@ -550,6 +532,15 @@ views::View* ContentSettingBubbleContents::CreateExtraView() {
const auto& bubble_content = content_setting_bubble_model_->bubble_content(); const auto& bubble_content = content_setting_bubble_model_->bubble_content();
const auto* layout = ChromeLayoutProvider::Get(); const auto* layout = ChromeLayoutProvider::Get();
std::vector<View*> extra_views; std::vector<View*> extra_views;
// Optionally add a help icon if the view wants to link to a help page.
if (bubble_content.show_learn_more) {
learn_more_button_ = views::CreateVectorImageButton(this);
learn_more_button_->SetFocusForPlatform();
learn_more_button_->SetTooltipText(
l10n_util::GetStringUTF16(IDS_LEARN_MORE));
StyleLearnMoreButton(GetNativeTheme());
extra_views.push_back(learn_more_button_);
}
// Optionally add a "Manage" button if the view wants to use a button to // Optionally add a "Manage" button if the view wants to use a button to
// invoke a separate management UI related to the dialog content. // invoke a separate management UI related to the dialog content.
if (bubble_content.manage_text_style == if (bubble_content.manage_text_style ==
...@@ -563,15 +554,6 @@ views::View* ContentSettingBubbleContents::CreateExtraView() { ...@@ -563,15 +554,6 @@ views::View* ContentSettingBubbleContents::CreateExtraView() {
0)); 0));
extra_views.push_back(manage_button_); extra_views.push_back(manage_button_);
} }
// Optionally add a help icon if the view wants to link to a help page.
if (bubble_content.show_learn_more) {
learn_more_button_ = views::CreateVectorImageButton(this);
learn_more_button_->SetFocusForPlatform();
learn_more_button_->SetTooltipText(
l10n_util::GetStringUTF16(IDS_LEARN_MORE));
StyleLearnMoreButton(GetNativeTheme());
extra_views.push_back(learn_more_button_);
}
if (extra_views.empty()) if (extra_views.empty())
return nullptr; return nullptr;
if (extra_views.size() == 1) if (extra_views.size() == 1)
......
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