Commit 7c360ee8 authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Commit Bot

[CrOS Settings] Add missing display search tags

Also add missing mojom::Setting enum values and register them within the
section.

Bug: 1083518
Change-Id: I0e7b0372e0d9dcf5e9bf0ebdaa064f250dd724f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2227791Reviewed-by: default avatarRegan Hsu <hsuregan@chromium.org>
Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Auto-Submit: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774655}
parent c5431f18
......@@ -478,14 +478,26 @@
<message name="IDS_OS_SETTINGS_TAG_DISPLAY_ARRANGEMENT_ALT2" desc="Text for search result item which, when clicked, navigates the user to display settings, with the ability to rearrange screen positioning. Alternate phrase for: 'Display arrangement', 'Monitor arrangement'">
Screen arrangement
</message>
<message name="IDS_OS_SETTINGS_TAG_DISPLAY_ORIENTATION" desc="Text for search result item which, when clicked, navigates the user to display settings, with a dropdown to select screen orientation. Alternate phrase for: 'Monitor orientation', 'Screen orientation'">
<message name="IDS_OS_SETTINGS_TAG_MIRRORING" desc="Text for search result item which, when clicked, navigates the user to display settings, with a checkbox to enable/disable display mirroring.">
Display mirroring
</message>
<message name="IDS_OS_SETTINGS_TAG_UNIFIED_DESKTOP" desc="Text for search result item which, when clicked, navigates the user to display settings, with a toggle to enable/disable Unified Desktop mode, which allows windows to span multiple displays.">
Allow windows to span displays
</message>
<message name="IDS_OS_SETTINGS_TAG_DISPLAY_ORIENTATION" desc="Text for search result item which, when clicked, navigates the user to display settings, with a dropdown to select display orientation (normal, or rotated 90/180/270 degrees). Alternate phrase for 'Display orientation'">
Display orientation
</message>
<message name="IDS_OS_SETTINGS_TAG_DISPLAY_ORIENTATION_ALT1" desc="Text for search result item which, when clicked, navigates the user to display settings, with a dropdown to select screen orientation. Alternate phrase for: 'Display orientation', 'Screen orientation'">
Monitor orientation
<message name="IDS_OS_SETTINGS_TAG_DISPLAY_ORIENTATION_ALT1" desc="Text for search result item which, when clicked, navigates the user to display settings, with a dropdown to select display orientation (normal, or rotated 90/180/270 degrees). Alternate phrase for 'Display rotation'.">
Display rotation
</message>
<message name="IDS_OS_SETTINGS_TAG_DISPLAY_AMBIENT_COLORS" desc="Text for search result item which, when clicked, navigates the user to display settings, with a toggle to enable/disable ambient colors, which adapts the screen color to match the environment.">
Ambient colors
</message>
<message name="IDS_OS_SETTINGS_TAG_DISPLAY_TOUCHSCREEN_CALIBRATION" desc="Text for search result item which, when clicked, navigates the user to display settings, with a link to open the touchscreen calibration UI.">
Touchscreen calibration
</message>
<message name="IDS_OS_SETTINGS_TAG_DISPLAY_ORIENTATION_ALT2" desc="Text for search result item which, when clicked, navigates the user to display settings, with a dropdown to select screen orientation. Alternate phrase for: 'Display orientation', 'Monitor orientation'">
Screen orientation
<message name="IDS_OS_SETTINGS_TAG_NIGHT_LIGHT_COLOR_TEMPERATURE" desc="Text for search result item which, when clicked, navigates the user to display settings, with a slider to increase/decrease the 'color temperature' for Night Light, which makes it easier to look at the screen in dim light.">
Night Light color temperature
</message>
<message name="IDS_OS_SETTINGS_TAG_DOWNLOADED_CONTENT" desc="Text for search result item which, when clicked, navigates the user to downloaded content. Alternate phrase for: 'DLC'">
Downloaded Content
......
......@@ -97,6 +97,11 @@ enum Setting {
kDisplayResolution = 425,
kDisplayRefreshRate = 426,
kRemoveDlc = 427,
kDisplayMirroring = 428,
kAllowWindowsToSpanDisplays = 429,
kAmbientColors = 430,
kTouchscreenCalibration = 431,
kNightLightColorTemperature = 432,
// Personalization section.
kOpenWallpaper = 500,
......
......@@ -281,36 +281,30 @@ const std::vector<SearchConcept>& GetDisplayArrangementSearchConcepts() {
const std::vector<SearchConcept>& GetDisplayMirrorSearchConcepts() {
static const base::NoDestructor<std::vector<SearchConcept>> tags({
// TODO(khorimoto): Add "Display mirror" search concepts.
{IDS_OS_SETTINGS_TAG_MIRRORING,
mojom::kDisplaySubpagePath,
mojom::SearchResultIcon::kDisplay,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kDisplayMirroring}},
});
return *tags;
}
const std::vector<SearchConcept>& GetDisplayUnifiedDesktopSearchConcepts() {
static const base::NoDestructor<std::vector<SearchConcept>> tags({
// TODO(khorimoto): Add "Display with Unified Desktop" search concepts.
});
return *tags;
}
const std::vector<SearchConcept>& GetDisplayMultipleSearchConcepts() {
static const base::NoDestructor<std::vector<SearchConcept>> tags({
// TODO(khorimoto): Add "Display multiple" search concepts.
{IDS_OS_SETTINGS_TAG_UNIFIED_DESKTOP,
mojom::kDisplaySubpagePath,
mojom::SearchResultIcon::kDisplay,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kAllowWindowsToSpanDisplays}},
});
return *tags;
}
const std::vector<SearchConcept>& GetDisplayExternalSearchConcepts() {
static const base::NoDestructor<std::vector<SearchConcept>> tags({
{IDS_OS_SETTINGS_TAG_DISPLAY_ORIENTATION,
mojom::kDisplaySubpagePath,
mojom::SearchResultIcon::kDisplay,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kDisplayOrientation},
{IDS_OS_SETTINGS_TAG_DISPLAY_ORIENTATION_ALT1,
IDS_OS_SETTINGS_TAG_DISPLAY_ORIENTATION_ALT2,
SearchConcept::kAltTagEnd}},
{IDS_OS_SETTINGS_TAG_DISPLAY_RESOLUTION,
mojom::kDisplaySubpagePath,
mojom::SearchResultIcon::kDisplay,
......@@ -342,28 +336,50 @@ GetDisplayExternalWithRefreshSearchConcepts() {
const std::vector<SearchConcept>& GetDisplayOrientationSearchConcepts() {
static const base::NoDestructor<std::vector<SearchConcept>> tags({
// TODO(khorimoto): Add "Display orientation" search concepts.
{IDS_OS_SETTINGS_TAG_DISPLAY_ORIENTATION,
mojom::kDisplaySubpagePath,
mojom::SearchResultIcon::kDisplay,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kDisplayOrientation},
{IDS_OS_SETTINGS_TAG_DISPLAY_ORIENTATION_ALT1,
SearchConcept::kAltTagEnd}},
});
return *tags;
}
const std::vector<SearchConcept>& GetDisplayAmbientSearchConcepts() {
static const base::NoDestructor<std::vector<SearchConcept>> tags({
// TODO(khorimoto): Add "Display ambient" search concepts.
{IDS_OS_SETTINGS_TAG_DISPLAY_AMBIENT_COLORS,
mojom::kDisplaySubpagePath,
mojom::SearchResultIcon::kDisplay,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kAmbientColors}},
});
return *tags;
}
const std::vector<SearchConcept>& GetDisplayTouchCalibrationSearchConcepts() {
static const base::NoDestructor<std::vector<SearchConcept>> tags({
// TODO(khorimoto): Add "Display touch calibration" search concepts.
{IDS_OS_SETTINGS_TAG_DISPLAY_TOUCHSCREEN_CALIBRATION,
mojom::kDisplaySubpagePath,
mojom::SearchResultIcon::kDisplay,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kTouchscreenCalibration}},
});
return *tags;
}
const std::vector<SearchConcept>& GetDisplayNightLightOnSearchConcepts() {
static const base::NoDestructor<std::vector<SearchConcept>> tags({
// TODO(khorimoto): Add "Display Night Light on" search concepts.
{IDS_OS_SETTINGS_TAG_NIGHT_LIGHT_COLOR_TEMPERATURE,
mojom::kDisplaySubpagePath,
mojom::SearchResultIcon::kDisplay,
mojom::SearchResultDefaultRank::kLow,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kNightLightColorTemperature}},
});
return *tags;
}
......@@ -904,9 +920,17 @@ void DeviceSection::RegisterHierarchy(HierarchyGenerator* generator) const {
mojom::SearchResultIcon::kDisplay,
mojom::SearchResultDefaultRank::kMedium, mojom::kDisplaySubpagePath);
static constexpr mojom::Setting kDisplaySettings[] = {
mojom::Setting::kDisplaySize, mojom::Setting::kNightLight,
mojom::Setting::kDisplayOrientation, mojom::Setting::kDisplayArrangement,
mojom::Setting::kDisplayResolution, mojom::Setting::kDisplayRefreshRate,
mojom::Setting::kDisplaySize,
mojom::Setting::kNightLight,
mojom::Setting::kDisplayOrientation,
mojom::Setting::kDisplayArrangement,
mojom::Setting::kDisplayResolution,
mojom::Setting::kDisplayRefreshRate,
mojom::Setting::kDisplayMirroring,
mojom::Setting::kAllowWindowsToSpanDisplays,
mojom::Setting::kAmbientColors,
mojom::Setting::kTouchscreenCalibration,
mojom::Setting::kNightLightColorTemperature,
};
RegisterNestedSettingBulk(mojom::Subpage::kDisplay, kDisplaySettings,
generator);
......@@ -1043,12 +1067,6 @@ void DeviceSection::OnGetDisplayLayoutInfo(
registry()->RemoveSearchTags(GetDisplayUnifiedDesktopSearchConcepts());
}
// Multiple displays UI.
if (has_multiple_displays)
registry()->AddSearchTags(GetDisplayMultipleSearchConcepts());
else
registry()->RemoveSearchTags(GetDisplayMultipleSearchConcepts());
// External display settings.
if (has_external_display)
registry()->AddSearchTags(GetDisplayExternalSearchConcepts());
......
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