Commit 9cb8498a authored by rdevlin.cronin's avatar rdevlin.cronin Committed by Commit bot

[Extensions] Polish the suspicious extension bubble

Adjust the string for single extensions ("the following extension" instead of
"some extensions"), and point the link to the proper place.

BUG=474091
TBR=avi@chromium.org (micro cocoa change)

Review URL: https://codereview.chromium.org/1137503006

Cr-Commit-Position: refs/heads/master@{#330113}
parent cd286fd7
......@@ -784,9 +784,12 @@ For Chromium, processes used to display diagnostics information (such as this "a
</message>
<if expr="enable_extensions">
<message name="IDS_EXTENSIONS_UNSUPPORTED_DISABLED_BODY" desc="Body of the dialog shown when unsupported extensions have been disabled">
<message name="IDS_EXTENSIONS_MULTIPLE_UNSUPPORTED_DISABLED_BODY" desc="Body of the dialog shown when multiple unsupported extensions have been disabled.">
To make Chromium safer, we disabled some extensions that aren't listed in the <ph name="IDS_EXTENSION_WEB_STORE_TITLE">$1<ex>Chrome Web Store</ex></ph> and may have been added without your knowledge.
</message>
<message name="IDS_EXTENSIONS_SINGLE_UNSUPPORTED_DISABLED_BODY" desc="Body of the dialog shown when a single unsupported extension has been disabled.">
To make Chromium safer, we disabled the following extension that isn't listed in the <ph name="IDS_EXTENSION_WEB_STORE_TITLE">$1<ex>Chrome Web Store</ex></ph> and may have been added without your knowledge.
</message>
</if>
<!-- Main Chrome menu -->
......
......@@ -707,9 +707,12 @@ For Google Chrome, processes used to display diagnostics information (such as th
</message>
<if expr="enable_extensions">
<message name="IDS_EXTENSIONS_UNSUPPORTED_DISABLED_BODY" desc="Body of the dialog shown when unsupported extensions have been disabled">
<message name="IDS_EXTENSIONS_MULTIPLE_UNSUPPORTED_DISABLED_BODY" desc="Body of the dialog shown when multiple unsupported extensions have been disabled.">
To make Chrome safer, we disabled some extensions that aren't listed in the <ph name="IDS_EXTENSION_WEB_STORE_TITLE">$1<ex>Chrome Web Store</ex></ph> and may have been added without your knowledge.
</message>
<message name="IDS_EXTENSIONS_SINGLE_UNSUPPORTED_DISABLED_BODY" desc="Body of the dialog shown when a single unsupported extension has been disabled.">
To make Chrome safer, we disabled the following extension that isn't listed in the <ph name="IDS_EXTENSION_WEB_STORE_TITLE">$1<ex>Chrome Web Store</ex></ph> and may have been added without your knowledge.
</message>
</if>
<!-- Wrench menu -->
......
......@@ -41,7 +41,8 @@ class DevModeBubbleDelegate
ExtensionMessageBubbleController::BubbleAction user_action) override;
void PerformAction(const ExtensionIdList& list) override;
base::string16 GetTitle() const override;
base::string16 GetMessageBody(bool anchored_to_browser_action) const override;
base::string16 GetMessageBody(bool anchored_to_browser_action,
int extension_count) const override;
base::string16 GetOverflowText(
const base::string16& overflow_count) const override;
GURL GetLearnMoreUrl() const override;
......@@ -92,7 +93,8 @@ base::string16 DevModeBubbleDelegate::GetTitle() const {
}
base::string16 DevModeBubbleDelegate::GetMessageBody(
bool anchored_to_browser_action) const {
bool anchored_to_browser_action,
int extension_count) const {
return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_BODY);
}
......
......@@ -46,8 +46,10 @@ class ExtensionMessageBubbleController {
// icon, allowing the bubble to show a different message than when it is
// anchored against something else (e.g. show "This extension has..."
// instead of "An extension has...").
// |extension_count| is the number of extensions being referenced.
virtual base::string16 GetMessageBody(
bool anchored_to_browser_action) const = 0;
bool anchored_to_browser_action,
int extension_count) const = 0;
virtual base::string16 GetOverflowText(
const base::string16& overflow_count) const = 0;
virtual base::string16 GetLearnMoreLabel() const;
......
......@@ -40,7 +40,8 @@ class NtpOverriddenBubbleDelegate
override;
void PerformAction(const extensions::ExtensionIdList& list) override;
base::string16 GetTitle() const override;
base::string16 GetMessageBody(bool anchored_to_browser_action) const override;
base::string16 GetMessageBody(bool anchored_to_browser_action,
int extension_count) const override;
base::string16 GetOverflowText(
const base::string16& overflow_count) const override;
GURL GetLearnMoreUrl() const override;
......@@ -112,7 +113,8 @@ base::string16 NtpOverriddenBubbleDelegate::GetTitle() const {
}
base::string16 NtpOverriddenBubbleDelegate::GetMessageBody(
bool anchored_to_browser_action) const {
bool anchored_to_browser_action,
int extension_count) const {
base::string16 body =
l10n_util::GetStringUTF16(IDS_EXTENSIONS_NTP_CONTROLLED_FIRST_LINE);
body += l10n_util::GetStringUTF16(
......
......@@ -44,7 +44,8 @@ class ProxyOverriddenBubbleDelegate
ExtensionMessageBubbleController::BubbleAction user_action) override;
void PerformAction(const ExtensionIdList& list) override;
base::string16 GetTitle() const override;
base::string16 GetMessageBody(bool anchored_to_browser_action) const override;
base::string16 GetMessageBody(bool anchored_to_browser_action,
int extension_count) const override;
base::string16 GetOverflowText(
const base::string16& overflow_count) const override;
GURL GetLearnMoreUrl() const override;
......@@ -122,7 +123,8 @@ base::string16 ProxyOverriddenBubbleDelegate::GetTitle() const {
}
base::string16 ProxyOverriddenBubbleDelegate::GetMessageBody(
bool anchored_to_browser_action) const {
bool anchored_to_browser_action,
int extension_count) const {
if (anchored_to_browser_action) {
return l10n_util::GetStringUTF16(
IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE_EXTENSION_SPECIFIC);
......
......@@ -46,7 +46,8 @@ class SettingsApiBubbleDelegate
ExtensionMessageBubbleController::BubbleAction user_action) override;
void PerformAction(const ExtensionIdList& list) override;
base::string16 GetTitle() const override;
base::string16 GetMessageBody(bool anchored_to_browser_action) const override;
base::string16 GetMessageBody(bool anchored_to_browser_action,
int extension_count) const override;
base::string16 GetOverflowText(
const base::string16& overflow_count) const override;
GURL GetLearnMoreUrl() const override;
......@@ -149,7 +150,8 @@ base::string16 SettingsApiBubbleDelegate::GetTitle() const {
}
base::string16 SettingsApiBubbleDelegate::GetMessageBody(
bool anchored_to_browser_action) const {
bool anchored_to_browser_action,
int extension_count) const {
ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
const Extension* extension =
registry->GetExtensionById(extension_id_, ExtensionRegistry::ENABLED);
......
......@@ -46,7 +46,8 @@ class SuspiciousExtensionBubbleDelegate
ExtensionMessageBubbleController::BubbleAction user_action) override;
void PerformAction(const extensions::ExtensionIdList& list) override;
base::string16 GetTitle() const override;
base::string16 GetMessageBody(bool anchored_to_browser_action) const override;
base::string16 GetMessageBody(bool anchored_to_browser_action,
int extension_count) const override;
base::string16 GetOverflowText(
const base::string16& overflow_count) const override;
GURL GetLearnMoreUrl() const override;
......@@ -101,9 +102,13 @@ base::string16 SuspiciousExtensionBubbleDelegate::GetTitle() const {
}
base::string16 SuspiciousExtensionBubbleDelegate::GetMessageBody(
bool anchored_to_browser_action) const {
return l10n_util::GetStringFUTF16(IDS_EXTENSIONS_UNSUPPORTED_DISABLED_BODY,
l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE));
bool anchored_to_browser_action,
int extension_count) const {
int message_id = extension_count == 1 ?
IDS_EXTENSIONS_SINGLE_UNSUPPORTED_DISABLED_BODY :
IDS_EXTENSIONS_MULTIPLE_UNSUPPORTED_DISABLED_BODY;
return l10n_util::GetStringFUTF16(
message_id, l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE));
}
base::string16 SuspiciousExtensionBubbleDelegate::GetOverflowText(
......
......@@ -34,7 +34,9 @@ base::string16 ExtensionMessageBubbleBridge::GetHeadingText() {
}
base::string16 ExtensionMessageBubbleBridge::GetBodyText() {
return controller_->delegate()->GetMessageBody(anchored_to_extension_);
return controller_->delegate()->GetMessageBody(
anchored_to_extension_,
controller_->GetExtensionIdList().size());
}
base::string16 ExtensionMessageBubbleBridge::GetItemListText() {
......
......@@ -123,7 +123,8 @@ void ExtensionMessageBubbleView::Init() {
message->SetMultiLine(true);
message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
message->SetText(delegate->GetMessageBody(
anchor_view_->id() == VIEW_ID_BROWSER_ACTION));
anchor_view_->id() == VIEW_ID_BROWSER_ACTION,
controller_->GetExtensionIdList().size()));
message->SizeToFit(views::Widget::GetLocalizedContentsWidth(
IDS_EXTENSION_WIPEOUT_BUBBLE_WIDTH_CHARS));
layout->AddView(message);
......
......@@ -573,8 +573,7 @@ const char kLearnMoreEnterpriseURL[] =
#endif
const char kRemoveNonCWSExtensionURL[] =
"https://support.google.com/chrome/answer/2811969?"
"p=ui_remove_non_cws_extensions&rd=1";
"https://support.google.com/chrome/?p=ui_remove_non_cws_extensions";
#if defined(OS_WIN)
const char kNotificationsHelpURL[] =
......
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