Commit c8479a41 authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Commit Bot

[CrOS Settings] Add "battery" search tags

Previously, we had one settings enum value for idle power, but I renamed
it and split it into two: one while charging and one while on battery,
which matches the settings page.

Bug: 1083518
Change-Id: Ib5f51ed5094252878dfe1f287a031dc644112eab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2227970
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Auto-Submit: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarRegan Hsu <hsuregan@chromium.org>
Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774705}
parent 492eddf8
...@@ -394,11 +394,17 @@ ...@@ -394,11 +394,17 @@
<message name="IDS_OS_SETTINGS_TAG_POWER" desc="Text for search result item which, when clicked, navigates the user to power settings."> <message name="IDS_OS_SETTINGS_TAG_POWER" desc="Text for search result item which, when clicked, navigates the user to power settings.">
Power Power
</message> </message>
<message name="IDS_OS_SETTINGS_TAG_POWER_IDLE" desc="Text for search result item which, when clicked, navigates the user to power settings, with an option to set the idle (i.e., sleep) behavior. Alternate phrase for: 'Sleep settings'"> <message name="IDS_OS_SETTINGS_TAG_POWER_IDLE_WHILE_CHARGING" desc="Text for search result item which, when clicked, navigates the user to power settings, with an option to set the idle (i.e., sleep) behavior while charging. Alternate phrase for: 'Sleep while charging'">
Idle power Idle power while charging
</message> </message>
<message name="IDS_OS_SETTINGS_TAG_POWER_IDLE_ALT1" desc="Text for search result item which, when clicked, navigates the user to power settings, with an option to set the idle (i.e., sleep) behavior. Alternate phrase for: 'Idle power settings'"> <message name="IDS_OS_SETTINGS_TAG_POWER_IDLE_WHILE_CHARGING_ALT1" desc="Text for search result item which, when clicked, navigates the user to power settings, with an option to set the idle (i.e., sleep) behavior while charging. Alternate phrase for: 'Idle power while charging'">
Sleep settings Sleep while charging
</message>
<message name="IDS_OS_SETTINGS_TAG_POWER_IDLE_WHILE_ON_BATTERY" desc="Text for search result item which, when clicked, navigates the user to power settings, with an option to set the idle (i.e., sleep) behavior while on the device is being powered by its battery. Alternate phrase for: 'Sleep while on battery'">
Idle power on battery
</message>
<message name="IDS_OS_SETTINGS_TAG_POWER_IDLE_WHILE_ON_BATTERY_ALT1" desc="Text for search result item which, when clicked, navigates the user to power settings, with an option to set the idle (i.e., sleep) behavior while on the device is being powered by its battery. Alternate phrase for: 'Idle power on battery'">
Sleep while on battery
</message> </message>
<message name="IDS_OS_SETTINGS_TAG_TOUCHPAD" desc="Text for search result item which, when clicked, navigates the user to touchpad settings. Alternate phrase for: 'Trackpad'"> <message name="IDS_OS_SETTINGS_TAG_TOUCHPAD" desc="Text for search result item which, when clicked, navigates the user to touchpad settings. Alternate phrase for: 'Trackpad'">
Touchpad Touchpad
......
...@@ -91,7 +91,7 @@ enum Setting { ...@@ -91,7 +91,7 @@ enum Setting {
kStylusLatestNoteOnLockScreen = 419, kStylusLatestNoteOnLockScreen = 419,
kDisplayOrientation = 420, kDisplayOrientation = 420,
kDisplayArrangement = 421, kDisplayArrangement = 421,
kPowerIdleBehavior = 422, kPowerIdleBehaviorWhileCharging = 422,
kPowerSource = 423, kPowerSource = 423,
kSleepWhenLaptopLidClosed = 424, kSleepWhenLaptopLidClosed = 424,
kDisplayResolution = 425, kDisplayResolution = 425,
...@@ -102,6 +102,7 @@ enum Setting { ...@@ -102,6 +102,7 @@ enum Setting {
kAmbientColors = 430, kAmbientColors = 430,
kTouchscreenCalibration = 431, kTouchscreenCalibration = 431,
kNightLightColorTemperature = 432, kNightLightColorTemperature = 432,
kPowerIdleBehaviorWhileOnBattery = 433,
// Personalization section. // Personalization section.
kOpenWallpaper = 500, kOpenWallpaper = 500,
......
...@@ -121,13 +121,22 @@ const std::vector<SearchConcept>& GetDeviceSearchConcepts() { ...@@ -121,13 +121,22 @@ const std::vector<SearchConcept>& GetDeviceSearchConcepts() {
mojom::SearchResultDefaultRank::kMedium, mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting, mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kKeyboardFunctionKeys}}, {.setting = mojom::Setting::kKeyboardFunctionKeys}},
{IDS_OS_SETTINGS_TAG_POWER_IDLE, {IDS_OS_SETTINGS_TAG_POWER_IDLE_WHILE_CHARGING,
mojom::kPowerSubpagePath, mojom::kPowerSubpagePath,
mojom::SearchResultIcon::kPower, mojom::SearchResultIcon::kPower,
mojom::SearchResultDefaultRank::kMedium, mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting, mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kPowerIdleBehavior}, {.setting = mojom::Setting::kPowerIdleBehaviorWhileCharging},
{IDS_OS_SETTINGS_TAG_POWER_IDLE_ALT1, SearchConcept::kAltTagEnd}}, {IDS_OS_SETTINGS_TAG_POWER_IDLE_WHILE_CHARGING_ALT1,
SearchConcept::kAltTagEnd}},
{IDS_OS_SETTINGS_TAG_POWER_IDLE_WHILE_ON_BATTERY,
mojom::kPowerSubpagePath,
mojom::SearchResultIcon::kPower,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kPowerIdleBehaviorWhileOnBattery},
{IDS_OS_SETTINGS_TAG_POWER_IDLE_WHILE_ON_BATTERY_ALT1,
SearchConcept::kAltTagEnd}},
}); });
return *tags; return *tags;
} }
...@@ -958,7 +967,8 @@ void DeviceSection::RegisterHierarchy(HierarchyGenerator* generator) const { ...@@ -958,7 +967,8 @@ void DeviceSection::RegisterHierarchy(HierarchyGenerator* generator) const {
mojom::SearchResultIcon::kPower, mojom::SearchResultDefaultRank::kMedium, mojom::SearchResultIcon::kPower, mojom::SearchResultDefaultRank::kMedium,
mojom::kPowerSubpagePath); mojom::kPowerSubpagePath);
static constexpr mojom::Setting kPowerSettings[] = { static constexpr mojom::Setting kPowerSettings[] = {
mojom::Setting::kPowerIdleBehavior, mojom::Setting::kPowerIdleBehaviorWhileCharging,
mojom::Setting::kPowerIdleBehaviorWhileOnBattery,
mojom::Setting::kPowerSource, mojom::Setting::kPowerSource,
mojom::Setting::kSleepWhenLaptopLidClosed, mojom::Setting::kSleepWhenLaptopLidClosed,
}; };
......
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