Commit 29b4a806 authored by James Cook's avatar James Cook Committed by Commit Bot

SplitSettings: Tooltip and new string for OS search engine selection

* "Preferred search engine"
* "Used by Chrome browser and <device> launcher"

http://screen/zTiXifEKNT6

TODO: Style tooltip to spec. We should change all OS settings tooltips
to use the same styling.

Bug: 978464
Change-Id: If434d82607faaba0278da0a29112e8bd791281d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1719268Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681070}
parent 1815d00a
......@@ -33,7 +33,10 @@
<!-- Search and Assistant section. -->
<message name="IDS_OS_SETTINGS_SEARCH_ENGINE_LABEL" desc="Label in OS settings describing search engine behavior.">
Searches from the app launcher use your browser <ph name="BEGIN_LINK">&lt;a target="_blank" href="$1"&gt;</ph>search engine setting<ph name="END_LINK">&lt;/a&gt;</ph>.
Preferred search engine
</message>
<message name="IDS_OS_SETTINGS_SEARCH_ENGINE_TOOLTIP" desc="Tooltip in OS settings explaining that search engine is used in both the Chrome browser and the Chrome OS app launcher.">
Used by Chrome browser and <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> launcher
</message>
<!-- Files Page (OS settings) -->
......
......@@ -6,6 +6,8 @@
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-tooltip/paper-tooltip.html">
<link rel="import" href="../../controls/extension_controlled_indicator.html">
<link rel="import" href="../../google_assistant_page/google_assistant_page.html">
<link rel="import" href="../../google_assistant_page/google_assistant_browser_proxy.html">
......@@ -27,8 +29,20 @@
min-height: var(--settings-row-min-height);
}
/* TODO(jamescook): Style all OS settings tooltips to new spec. */
paper-tooltip {
--paper-tooltip: {
@apply --cr-tooltip;
padding: 12px 10px;
};
}
iron-icon {
padding-inline-end: 16px;
--iron-icon-fill-color: var(--google-grey-refresh-500);
}
cr-policy-pref-indicator {
padding-inline-end: 8px;
}
</style>
<settings-animated-pages id="pages" section="search"
......@@ -40,7 +54,14 @@
<div class="settings-box first block">
<div id="search-wrapper">
<div id="searchExplanation" class="start settings-box-text">
$i18nRaw{searchExplanation}
$i18n{osSearchEngineLabel}
<iron-icon id="help-icon" icon="cr:help-outline"
aria-label="$i18n{osSearchEngineTooltip}"
aria-describedby="tooltip"></iron-icon>
<paper-tooltip id="tooltip" for="help-icon" position="bottom"
fit-to-visible-bounds>
$i18n{osSearchEngineTooltip}
</paper-tooltip>
</div>
<template is="dom-if" if="[[isDefaultSearchControlledByPolicy_(
prefs.default_search_provider_data.template_url_data)]]">
......
......@@ -2486,6 +2486,7 @@ void AddSearchStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"osSearchPageTitle", is_assistant_allowed
? IDS_SETTINGS_SEARCH_AND_ASSISTANT
: IDS_SETTINGS_SEARCH},
{"osSearchEngineLabel", IDS_OS_SETTINGS_SEARCH_ENGINE_LABEL},
{"searchGoogleAssistant", IDS_SETTINGS_SEARCH_GOOGLE_ASSISTANT},
{"searchGoogleAssistantEnabled",
IDS_SETTINGS_SEARCH_GOOGLE_ASSISTANT_ENABLED},
......@@ -2500,6 +2501,9 @@ void AddSearchStrings(content::WebUIDataSource* html_source, Profile* profile) {
base::ASCIIToUTF16(chrome::kOmniboxLearnMoreURL));
html_source->AddString("searchExplanation", search_explanation_text);
#if defined(OS_CHROMEOS)
html_source->AddString(
"osSearchEngineTooltip",
ui::SubstituteChromeOSDeviceType(IDS_OS_SETTINGS_SEARCH_ENGINE_TOOLTIP));
html_source->AddBoolean("isAssistantAllowed", is_assistant_allowed);
#endif
}
......
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