Commit 5b9b392d authored by rdevlin.cronin's avatar rdevlin.cronin Committed by Commit bot

[Extensions] Adjust strings in the extension message bubble

Adjust the strings in the extension message bubble to indicate which extension
is overriding certain settings if it's not point to a specific one. If it is
pointing to a specific one, use "This extension".

BUG=485614

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

Cr-Commit-Position: refs/heads/master@{#329873}
parent 301dc6dc
......@@ -1192,8 +1192,11 @@ Signing in anyway will merge Chromium information like bookmarks, history, and o
</if>
<!-- Settings API bubble -->
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES" desc="Text displayed in the Settings API bubble as first line when an extension has changed the start pages.">
An extension has changed what page is shown when you start Chromium.
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES_SPECIFIC" desc="Text displayed in the Settings API bubble as first line when an extension has changed the start pages, and we are pointing to its icon.">
This extension has changed what page is shown when you start Chromium.
</message>
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES" desc="Text displayed in the Settings API bubble as first line when an extension has changed the start pages, and we are not pointing to its icon.">
The extension "<ph name="EXTENSION_NAME">$1<ex>AdBlock</ex></ph>" has changed what page is shown when you start Chromium.
</message>
<message name="IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_PAGES" desc="Second line in the Settings API bubble. Only shown if the secondary change by the extension was just the start pages. The triple single quotes are needed to preserve the space before and after the sentence which is needed when the language (Chrome is being translated to) uses space as word separator. Please preserve them, unless the language being translated to does not use space as word separator.">
''' It also controls what page is shown when you start Chromium. '''
......
......@@ -5329,11 +5329,17 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
</if>
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_SEARCH_ENGINE" desc="Text displayed as the first line in the Settings API bubble when an extension has changed the search engine.">
An extension has changed what page is shown when you search from the Omnibox.
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_SEARCH_ENGINE_SPECIFIC" desc="Text displayed as the first line in the Settings API bubble when an extension has changed the search engine, and we are pointing to its icon.">
This extension has changed what page is shown when you search from the Omnibox.
</message>
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_HOME_PAGE" desc="Text displayed in the Settings API bubble as first line when an extension has changed the home page.">
An extension has changed what page is shown when you click the Home button.
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_SEARCH_ENGINE" desc="Text displayed as the first line in the Settings API bubble when an extension has changed the search engine, and we are not pointing to its icon.">
The extension "<ph name="EXTENSION_NAME">$1<ex>AdBlock</ex></ph>" has changed what page is shown when you search from the Omnibox.
</message>
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_HOME_PAGE_SPECIFIC" desc="Text displayed in the Settings API bubble as first line when an extension has changed the home page, and we are pointing to its icon.">
This extension has changed what page is shown when you click the Home button.
</message>
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_HOME_PAGE" desc="Text displayed in the Settings API bubble as first line when an extension has changed the home page, and we are not pointing to its icon.">
The extension "<ph name="EXTENSION_NAME">$1<ex>AdBlock</ex></ph>" has changed what page is shown when you click the Home button.
</message>
<message name="IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_SEARCH_ENGINE" desc="Second line in the Settings API bubble. Only shown if the secondary change by the extension was just the search engine. The triple single quotes are needed to preserve the space before and after the sentence which is needed when the language (Chrome is being translated to) uses space as word separator. Please preserve them, unless the language being translated to does not use space as word separator.">
......@@ -5351,7 +5357,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
<message name="IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE" desc="Text displayed as the first line in the proxy bubble when an extension has changed the proxy but we are not pointing at it's icon (because it doesn't have one).">
An extension has taken control of your proxy settings, which means it can change, break, or eavesdrop on anything you do online. If you aren't sure why this change happened, you probably don't want it.
The extension "<ph name="EXTENSION_NAME">$1<ex>AdBlock</ex></ph>" has taken control of your proxy settings, which means it can change, break, or eavesdrop on anything you do online. If you aren't sure why this change happened, you probably don't want it.
</message>
<message name="IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE_EXTENSION_SPECIFIC" desc="Text displayed as the first line in the proxy bubble when an extension has changed the proxy and we are pointing at that extension's icon.">
This extension has taken control of your proxy settings, which means it can change, break, or eavesdrop on anything you do online. If you aren't sure why this change happened, you probably don't want it.
......@@ -1115,8 +1115,11 @@ Signing in anyway will merge Chrome information like bookmarks, history, and oth
</if>
<!-- Settings API bubble -->
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES" desc="Text displayed in the Settings API bubble as first line when an extension has changed the start pages.">
An extension has changed what page is shown when you start Chrome.
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES_SPECIFIC" desc="Text displayed in the Settings API bubble as first line when an extension has changed the start pages, and we are pointing to its icon.">
This extension has changed what page is shown when you start Chrome.
</message>
<message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES" desc="Text displayed in the Settings API bubble as first line when an extension has changed the start pages, and we are not pointing to its icon.">
The extension "<ph name="EXTENSION_NAME">$1<ex>AdBlock</ex></ph>" has changed what page is shown when you start Chrome.
</message>
<message name="IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_PAGES" desc="Second line in the Settings API bubble. Only shown if the secondary change by the extension was just the start pages. The triple single quotes are needed to preserve the space before and after the sentence which is needed when the language (Chrome is being translated to) uses space as word separator. Please preserve them, unless the language being translated to does not use space as word separator.">
''' It also controls what page is shown when you start Chrome. '''
......
......@@ -5,6 +5,7 @@
#include "chrome/browser/extensions/proxy_overridden_bubble_controller.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/settings_api_helpers.h"
#include "chrome/browser/profiles/profile.h"
......@@ -126,8 +127,14 @@ base::string16 ProxyOverriddenBubbleDelegate::GetMessageBody(
return l10n_util::GetStringUTF16(
IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE_EXTENSION_SPECIFIC);
} else {
return l10n_util::GetStringUTF16(
IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE);
const Extension* extension =
ExtensionRegistry::Get(profile())->GetExtensionById(
extension_id_, ExtensionRegistry::EVERYTHING);
// If the bubble is about to show, the extension should certainly exist.
CHECK(extension);
return l10n_util::GetStringFUTF16(
IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE,
base::UTF8ToUTF16(extension->name()));
}
}
......
// Copyright (c) 2014 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/settings_api_bubble_controller.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/settings_api_helpers.h"
#include "chrome/browser/profiles/profile.h"
......@@ -163,54 +164,60 @@ base::string16 SettingsApiBubbleDelegate::GetMessageBody(
bool startup_change = !settings->startup_pages.empty();
bool search_change = settings->search_engine != NULL;
int first_line_id = 0;
int second_line_id = 0;
base::string16 body;
switch (type_) {
case BUBBLE_TYPE_HOME_PAGE:
body = l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_HOME_PAGE);
first_line_id = anchored_to_browser_action ?
IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_HOME_PAGE_SPECIFIC :
IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_HOME_PAGE;
if (startup_change && search_change) {
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_AND_SEARCH);
second_line_id =
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_AND_SEARCH;
} else if (startup_change) {
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_PAGES);
second_line_id = IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_PAGES;
} else if (search_change) {
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_SEARCH_ENGINE);
second_line_id = IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_SEARCH_ENGINE;
}
break;
case BUBBLE_TYPE_STARTUP_PAGES:
body = l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES);
first_line_id = anchored_to_browser_action ?
IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES_SPECIFIC :
IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES;
if (home_change && search_change) {
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_HOME_AND_SEARCH);
second_line_id =
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_HOME_AND_SEARCH;
} else if (home_change) {
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_HOME_PAGE);
second_line_id = IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_HOME_PAGE;
} else if (search_change) {
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_SEARCH_ENGINE);
second_line_id = IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_SEARCH_ENGINE;
}
break;
case BUBBLE_TYPE_SEARCH_ENGINE:
body = l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_SEARCH_ENGINE);
if (startup_change && home_change) {
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_AND_HOME);
} else if (startup_change) {
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_PAGES);
} else if (home_change) {
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_HOME_PAGE);
}
first_line_id = anchored_to_browser_action ?
IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_SEARCH_ENGINE_SPECIFIC :
IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_SEARCH_ENGINE;
if (startup_change && home_change)
second_line_id = IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_AND_HOME;
else if (startup_change)
second_line_id = IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_PAGES;
else if (home_change)
second_line_id = IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_HOME_PAGE;
break;
}
if (!body.empty())
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_THIRD_LINE_CONFIRMATION);
DCHECK_NE(0, first_line_id);
body = anchored_to_browser_action ?
l10n_util::GetStringUTF16(first_line_id) :
l10n_util::GetStringFUTF16(first_line_id,
base::UTF8ToUTF16(extension->name()));
if (second_line_id)
body += l10n_util::GetStringUTF16(second_line_id);
body += l10n_util::GetStringUTF16(
IDS_EXTENSIONS_SETTINGS_API_THIRD_LINE_CONFIRMATION);
return body;
}
......
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