Skip to content

Commit

Permalink
[Privacy Hub] Add search concepts
Browse files Browse the repository at this point in the history
Adds search concept for some contents in the Privacy controls page.

Bug: b/254911300
Change-Id: I0c628e581b3221940020fd7afc39983d91dabd91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4001582
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Md Shahadat Hossain Shahin <shahinmd@google.com>
Reviewed-by: Wes Okuhara <wesokuhara@google.com>
Cr-Commit-Position: refs/heads/main@{#1067459}
  • Loading branch information
Md Shahadat Hossain Shahin authored and Chromium LUCI CQ committed Nov 4, 2022
1 parent 659a059 commit 89a61e0
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 0 deletions.
12 changes: 12 additions & 0 deletions chrome/app/os_settings_search_tag_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,18 @@
<message name="IDS_OS_SETTINGS_TAG_SMART_PRIVACY_QUICK_DIM" desc="Text for search result item which, when clicked, navigates the user to the smart privacy subpage with a toggle to enable/disable quick dim." translateable="false">
Smart screen lock
</message>
<message name="IDS_OS_SETTINGS_TAG_PRIVACY_CONTROLS" desc="Text for search result item which, when clicked, navigates the user to the Privacy controls subpage.">
Privacy controls
</message>
<message name="IDS_OS_SETTINGS_TAG_CAMERA" desc="Text for search result item which, when clicked, navigates the user to Camera access settings.">
Camera access
</message>
<message name="IDS_OS_SETTINGS_TAG_GEOLOCATION" desc="Text for search result item which, when clicked, navigates the user to Location access settings.">
Location access
</message>
<message name="IDS_OS_SETTINGS_TAG_MICROPHONE" desc="Text for search result item which, when clicked, navigates the user to Microphone access settings.">
Microphone access
</message>

<!-- Languages and Input section. -->
<message name="IDS_OS_SETTINGS_TAG_LANGUAGES" desc="Text for search result item which, when clicked, navigates the user to languages settings.">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8a6a82bbcba8d6c4378a80ff8317d796d50d0823
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
78e8ef1d07e6024d072f7f9d75ba38317e7b030d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
52c9f0584c03e87f62a0d44800d5ad92ac394d07
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
646d703f809826994e8238e772bf26af42807081
3 changes: 3 additions & 0 deletions chrome/browser/resources/settings/chromeos/os_icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<g id="audio"><path fill-rule="evenodd" clip-rule="evenodd" d="M1 13H4.46667L8 16.4V3.40002L4.46667 7.00002H1V13ZM10 6.40002V13.4C11.776 12.7652 12.5 10.9044 12.5 9.90002C12.5 8.89568 11.776 7.0435 10 6.40002ZM10 4.16171C12.4771 4.89717 14.5 7.18908 14.5 9.90002C14.5 12.611 12.4771 14.9029 10 15.6383V17.4C13.4371 16.6218 16 13.5602 16 9.90002C16 6.23982 13.4371 3.17825 10 2.40002V4.16171Z"></path></g>
<g id="auth-key"><path d="M6.364 5C3.956 5 2 7.018 2 9.5S3.956 14 6.364 14c1.898 0 3.512-1.252 4.11-3H13.5v3h3v-3H18V8h-7.527c-.597-1.747-2.21-3-4.11-3zm0 6c-.8 0-1.455-.675-1.455-1.5S5.563 8 6.363 8c.8 0 1.454.675 1.454 1.5S7.164 11 6.364 11z"></path></g>
<g id="autoclick" viewBox="0 0 20 20"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 10a3 3 0 1 0 6 0 3 3 0 0 0-6 0Zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M10 2c-4.416 0-8 3.584-8 8s3.584 8 8 8 8-3.584 8-8-3.584-8-8-8Zm0 14c-3.308 0-6-2.693-6-6 0-3.308 2.692-6 6-6 3.307 0 6 2.692 6 6 0 3.307-2.693 6-6 6Z"></path></g>
<g id="camera"><path d="M10 13C11.3807 13 12.5 11.8807 12.5 10.5C12.5 9.11929 11.3807 8 10 8C8.61929 8 7.5 9.11929 7.5 10.5C7.5 11.8807 8.61929 13 10 13Z" fill="#1B1B1F"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M12 3H8L6 5H4C3.44772 5 3 5.44772 3 6V15C3 15.5523 3.44772 16 4 16H16C16.5523 16 17 15.5523 17 15V6C17 5.44772 16.5523 5 16 5H14L12 3ZM5 7H15V14H5V7Z" fill="#1B1B1F"></path></g>
<g id="cellular"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.002 15.002V7.41622L7.41622 15.002H15.002ZM16.002 17.002C16.5543 17.002 17.002 16.5543 17.002 16.002V5.002C17.002 4.1111 15.9249 3.66493 15.2949 4.2949L4.2949 15.2949C3.66493 15.9249 4.1111 17.002 5.002 17.002H16.002Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 16.002C13.5 16.5543 13.0523 17.002 12.5 17.002H5.002C4.1111 17.002 3.66493 15.9249 4.2949 15.2949L11.7929 7.79289C12.4229 7.16293 13.5 7.6091 13.5 8.5V16.002Z"></path></g>
<g id="chrome"><path d="M17.4167 6.24996H10C8.16671 6.24996 6.58337 7.66663 6.33337 9.41663L3.58337 4.66663C5.08337 2.83329 7.41671 1.66663 10 1.66663C13.25 1.66663 16.0834 3.49996 17.4167 6.24996Z"></path><path d="M6.75002 11.8333C7.41669 13 8.58335 13.75 10 13.75C10.5 13.75 10.9167 13.6666 11.4167 13.5L8.66669 18.25C4.66669 17.5833 1.66669 14.1666 1.66669 9.99996C1.66669 8.33329 2.16669 6.74996 3.00002 5.41663L6.75002 11.8333Z"></path><path d="M13.75 9.99992C13.75 10.6666 13.5833 11.3333 13.25 11.8333L9.5 18.3333H10C14.5833 18.3333 18.3333 14.5833 18.3333 9.99992C18.3333 8.99992 18.1667 7.99992 17.8333 7.08325H12.3333C13.1667 7.74992 13.75 8.83325 13.75 9.99992Z"></path><path d="M12.9167 9.99992C12.9167 11.6107 11.6109 12.9166 10 12.9166C8.38921 12.9166 7.08337 11.6107 7.08337 9.99992C7.08337 8.38909 8.38921 7.08325 10 7.08325C11.6109 7.08325 12.9167 8.38909 12.9167 9.99992Z"></path></g>
<g id="chromevox" viewBox="0 0 20 20"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-5.335-3.549c-.259.259-.511.522-.762.79l.039.042c.696.775 1.467 1.633 1.413 2.738.068 1.127-.67 2.053-1.434 2.805.216.286.434.57.653.855 1.258-.839 2.037-2.313 1.937-3.812-.02-1.355-.798-2.58-1.846-3.418Zm3.772 5.35a6.562 6.562 0 0 1-2.562 3.566c-.233-.31-.458-.624-.678-.942l.205-.203c.524-.519 1.054-1.044 1.404-1.694.869-1.564.818-3.568-.099-5.102-.309-.514-.735-.943-1.158-1.37a31.85 31.85 0 0 1-.306-.311c.233-.306.467-.61.704-.914 2.262 1.469 3.192 4.445 2.49 6.97ZM8.768 3.68c-.11-.003-.225-.008-.345-.014-2.921.698-5.09 3.281-5.09 6.361 0 2.658 1.614 4.946 3.934 5.972a23.226 23.226 0 0 1 1.48-.387c.206-1.043.328-2.1.379-3.162-.481-.277-.981-.52-1.481-.763-.228-.11-.456-.221-.682-.335l.557-.104c.652-.12 1.305-.24 1.946-.416l.042-.633c.02-.295.038-.59.061-.886a61.936 61.936 0 0 1 1.548-.978 11.89 11.89 0 0 0-.813-1.77c-.202-.367-.389-.742-.575-1.117-.3-.6-.599-1.2-.96-1.767Z"></path></g>
Expand All @@ -119,6 +120,7 @@
<g id="display"><path fill-rule="evenodd" clip-rule="evenodd" d="M17.5 3H2.5C1.6 3 1 3.7 1 4.55556V14.5C1 15.3556 1.6 16 2.5 16H7V18H13V16H17.5C18.4 16 19 15.3556 19 14.5V4.5C19 3.64444 18.4 3 17.5 3ZM17 14H3V5H17V14Z"></path></g>
<g id="docked-magnifier" viewBox="0 0 20 20"><path d="M14 11V9h2V8h-2V6h-1v2h-2v1h2v2h1Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M17.5 3h-15C1.6 3 1 3.7 1 4.556V15.5c0 .856.6 1.5 1.5 1.5h15c.9 0 1.5-.644 1.5-1.5v-11c0-.856-.6-1.5-1.5-1.5Zm-.5 9H3V5h14v7Z"></path></g>
<g id="fullscreen-magnifier" viewBox="0 0 20 20"><path d="M14 11V9h2V8h-2V6h-1v2h-2v1h2v2h1Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M17.5 3h-15C1.6 3 1 3.7 1 4.556V15.5c0 .856.6 1.5 1.5 1.5h15c.9 0 1.5-.644 1.5-1.5v-11c0-.856-.6-1.5-1.5-1.5ZM17 15H3V5h14v10Z"></path></g>
<g id="geolocation"><path d="M12 8C12 9.10457 11.1046 10 10 10C8.89543 10 8 9.10457 8 8C8 6.89543 8.89543 6 10 6C11.1046 6 12 6.89543 12 8Z" fill="#1B1B1F"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M16 8C16 10.2091 14 13.5425 10 18C6 13.5425 4 10.2091 4 8C4 4.68629 6.68629 2 10 2C13.3137 2 16 4.68629 16 8ZM10 4C7.79086 4 6 5.79086 6 8C6 9.32543 7.318 11.7149 10 14.9435C12.682 11.7149 14 9.32543 14 8C14 5.79086 12.2091 4 10 4Z" fill="#1B1B1F"></path></g>
<g id="google-drive"><path fill-rule="evenodd" clip-rule="evenodd" d="M18.7333 12L13.0167 2H7.31665V2.00833L13.025 12H18.7333ZM8.27502 12.8334L5.41669 17.8334H16.35L19.2084 12.8334H8.27502ZM6.59167 3.26672L1.125 12.8334L3.98333 17.8251L9.45 8.26672C9.45 8.27506 6.59167 3.26672 6.59167 3.26672Z"></path></g>
<g id="google-play"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.8167 9.06658L14.2667 7.61658L11.8834 9.99991L14.2667 12.3832L16.8167 10.9332C17.275 10.6749 17.5 10.3416 17.5 9.99991C17.5 9.65824 17.275 9.32491 16.8167 9.06658ZM3.92498 2.04163C4.93332 3.04996 10.9417 9.05829 10.9417 9.05829L13.0666 6.93329L4.14998 1.88329C4.09165 1.84996 4.03332 1.82496 3.97498 1.79996C3.83332 1.74163 3.72498 1.84163 3.84998 1.97496C3.87498 1.99163 3.89998 2.01663 3.92498 2.04163ZM3.92501 17.9583C3.90001 17.9833 3.87501 18.0083 3.85834 18.025C3.73334 18.15 3.84168 18.2583 3.98334 18.2C4.04168 18.175 4.10001 18.15 4.15834 18.1166L13.0667 13.0667L10.9417 10.9417C10.9417 10.9417 4.94168 16.95 3.92501 17.9583ZM10 9.99995C10 9.99995 2.975 2.97495 2.81667 2.81662C2.65833 2.65828 2.5 2.75828 2.5 2.97495V17.025C2.5 17.2416 2.65833 17.3416 2.81667 17.1833C2.975 17.025 10 9.99995 10 9.99995Z"></path></g>
<g id="hard-drive"><path d="M14 14C14 14.5523 13.5523 15 13 15C12.4477 15 12 14.5523 12 14C12 13.4477 12.4477 13 13 13C13.5523 13 14 13.4477 14 14Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M5 2C3.89543 2 3 2.89543 3 4V16C3 17.1046 3.89543 18 5 18H15C16.1046 18 17 17.1046 17 16V4C17 2.89543 16.1046 2 15 2H5ZM5 16H15V12H5V16ZM5 10H15V4H5V10Z"></path></g>
Expand All @@ -127,6 +129,7 @@
<g id="lock"><path d="M11.75 12.5C11.75 13.4665 10.9665 14.25 10 14.25C9.0335 14.25 8.25 13.4665 8.25 12.5C8.25 11.5335 9.0335 10.75 10 10.75C10.9665 10.75 11.75 11.5335 11.75 12.5Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14 7H13.5V5C13.5 3.34315 11.6569 2 10 2C8.34315 2 6.5 3.34315 6.5 5V7H6C4.89543 7 4 7.89543 4 9V16C4 17.1046 4.89543 18 6 18H14C15.1046 18 16 17.1046 16 16V9C16 7.89543 15.1046 7 14 7ZM12 5.5V7H8V5.5C8 5 8.5 3.5 10 3.5C11.5 3.5 12 5 12 5.5ZM6 9V16H14V9H6Z"></path></g>
<g id="keyboard"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 3H2C0.9 3 0.01 3.9 0.01 5L0 15C0 16.1 0.9 17 2 17H18C19.1 17 20 16.1 20 15V5C20 3.9 19.1 3 18 3ZM18 5V15H2V5H18ZM11 6H9V8H11V6ZM9 9H11V11H9V9ZM8 6H6V8H8V6ZM6 9H8V11H6V9ZM5 9H3V11H5V9ZM3 6H5V8H3V6ZM14 12H6V14H14V12ZM12 9H14V11H12V9ZM14 6H12V8H14V6ZM15 9H17V11H15V9ZM17 6H15V8H17V6Z"></path></g>
<g id="magic-tethering"><path d="M19 6.49212C14.5855 1.83596 6.42182 1.83596 2 6.49212L3.5 8C7.5 3.97898 13.5 3.97898 17.5 8L19 6.49212Z"></path><path d="M6.23521 11L4.5 9.33611C5.90378 7.99334 7.67283 7.21963 9.5 7L8.2038 9.73544C7.48803 10.0225 6.81737 10.4418 6.23521 11Z"></path><path d="M16.5 9.33645L14.7651 11C14.183 10.4419 13.5125 10.0227 12.7968 9.7357L11.5 7C13.3286 7.21876 15.0982 7.99231 16.5 9.33645Z"></path><path d="M6.5 12.9992L9.2496 11.7496L10.4992 9L11.7496 11.7496L14.5 12.9992L11.7496 14.2504L10.4992 17L9.2496 14.2504L6.5 12.9992Z"></path></g>
<g id="microphone"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 12.1053C11.4229 12.1053 12.5629 10.9768 12.5629 9.57895L12.5714 4.52632C12.5714 3.12842 11.4229 2 10 2C8.57716 2 7.42859 3.12842 7.42859 4.52632V9.57895C7.42859 10.9768 8.57716 12.1053 10 12.1053ZM14.5429 9.57898C14.5429 12.1053 12.3657 13.8737 10 13.8737C7.63429 13.8737 5.45714 12.1053 5.45714 9.57898H4C4 12.459 6.33143 14.8253 9.14286 15.2379V18H10.8571V15.2379C13.6686 14.8337 16 12.459 16 9.57898H14.5429Z" fill="#1B1B1F"></path></g>
<g id="mouse"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 2C6.68286 2 4 4.504 4 7.6V12.4C4 15.496 6.68286 18 10 18C13.3171 18 16 15.496 16 12.4V7.6C16 4.504 13.3171 2 10 2ZM14 7.5V8H11V4C13 4 14 6 14 7.5ZM9 4V8H6V7.6C6 6 7 4 9 4ZM10 16C7.63429 16 6 14.608 6 12.4V10H14V12.4C14 14.608 12.3657 16 10 16Z"></path></g>
<g id="network-wifi"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.5554 16.7289C10.2698 17.0905 9.72802 17.0905 9.44247 16.7281L2.15749 7.49646C1.89621 7.16533 1.96831 6.68099 2.31239 6.44135C3.50455 5.61135 6.26792 4 10 4C13.7328 4 16.4955 5.61135 17.6876 6.44135C18.0317 6.68099 18.1038 7.16533 17.8425 7.49646L10.5554 16.7289ZM5.46762 8.4626L4.61134 7.37751C5.85753 6.71277 7.72159 6 10 6C12.2788 6 14.1425 6.71268 15.3886 7.37739L14.5315 8.46329C13.348 7.94707 11.8035 7.5 9.99865 7.5C8.19498 7.5 6.65099 7.94668 5.46762 8.4626Z"></path></g>
<g id="on-screen-keyboard" viewBox="0 0 20 20"><path fill-rule="evenodd" clip-rule="evenodd" d="M5 14V9h11v5H5Zm8-2H8v1h5v-1Zm-6-2h1v1H7v-1Zm3 0H9v1h1v-1Zm1 0h1v1h-1v-1Zm3 0h-1v1h1v-1Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2 4.669C2 3.75 2.736 3 3.636 3h13.728c.9 0 1.636.75 1.636 1.669v10.68c0 .917-.736 1.651-1.636 1.651H3.636C2.736 17 2 16.266 2 15.348V4.668ZM4 5v10h13V5H4Z"></path></g>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,8 @@ export class OsSearchResultRowElement extends OsSearchResultRowElementBase {
return 'cr:person';
case SearchResultIcon.kBluetooth:
return 'cr:bluetooth';
case SearchResultIcon.kCamera:
return 'os-settings:camera';
case SearchResultIcon.kCellular:
return 'os-settings:cellular';
case SearchResultIcon.kChrome:
Expand Down Expand Up @@ -706,6 +708,8 @@ export class OsSearchResultRowElement extends OsSearchResultRowElementBase {
return 'os-settings:folder-outline';
case SearchResultIcon.kFullscreenMagnifier:
return 'os-settings:fullscreen-magnifier';
case SearchResultIcon.kGeolocation:
return 'os-settings:geolocation';
case SearchResultIcon.kGlobe:
return 'os-settings:language';
case SearchResultIcon.kGooglePlay:
Expand All @@ -724,6 +728,8 @@ export class OsSearchResultRowElement extends OsSearchResultRowElementBase {
return 'cr:search';
case SearchResultIcon.kMessages:
return 'os-settings:multidevice-messages';
case SearchResultIcon.kMicrophone:
return 'os-settings:microphone';
case SearchResultIcon.kMouse:
return 'os-settings:mouse';
case SearchResultIcon.kNearbyShare:
Expand Down
45 changes: 45 additions & 0 deletions chrome/browser/ui/webui/settings/ash/privacy_section.cc
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,47 @@ const std::vector<SearchConcept>& GetPrivacyGoogleChromeSearchConcepts() {
}
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)

const std::vector<SearchConcept>& GetPrivacyControlsSearchConcepts() {
static const base::NoDestructor<std::vector<SearchConcept>> tags([] {
std::vector<SearchConcept> init_tags;

if (ash::features::IsCrosPrivacyHubEnabled()) {
init_tags.push_back({IDS_OS_SETTINGS_TAG_PRIVACY_CONTROLS,
mojom::kPrivacyHubSubpagePath,
mojom::SearchResultIcon::kShield,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSubpage,
{.subpage = mojom::Subpage::kPrivacyHub}});
init_tags.push_back({IDS_OS_SETTINGS_TAG_CAMERA,
mojom::kPrivacyHubSubpagePath,
mojom::SearchResultIcon::kCamera,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kCameraOnOff}});

init_tags.push_back({IDS_OS_SETTINGS_TAG_MICROPHONE,
mojom::kPrivacyHubSubpagePath,
mojom::SearchResultIcon::kMicrophone,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kMicrophoneOnOff}});
}

if (ash::features::IsCrosPrivacyHubV1Enabled()) {
init_tags.push_back({IDS_OS_SETTINGS_TAG_GEOLOCATION,
mojom::kPrivacyHubSubpagePath,
mojom::SearchResultIcon::kGeolocation,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kGeolocationOnOff}});
}

return init_tags;
}());

return *tags;
}

bool IsSecureDnsAvailable() {
return
#if BUILDFLAG(IS_CHROMEOS_ASH)
Expand Down Expand Up @@ -281,6 +322,10 @@ PrivacySection::PrivacySection(Profile* profile,
// Conditionally adds search tags concepts based on the subset of smart
// privacy functionality enabled.
updater.AddSearchTags(GetSmartPrivacySearchConcepts());

// Adds search concepts for the contents in the Privacy controls page
// depending on the enabled flags.
updater.AddSearchTags(GetPrivacyControlsSearchConcepts());
}

PrivacySection::~PrivacySection() = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum SearchResultIcon {
kAutoclick,
kAvatar,
kBluetooth,
kCamera,
kCellular,
kChrome,
kChromeVox,
Expand All @@ -29,6 +30,7 @@ enum SearchResultIcon {
kFingerprint,
kFolder,
kFullscreenMagnifier,
kGeolocation,
kGlobe,
kGooglePlay,
kHardDrive,
Expand All @@ -38,6 +40,7 @@ enum SearchResultIcon {
kLock,
kMagnifyingGlass,
kMessages,
kMicrophone,
kMouse,
kNearbyShare,
kOnScreenKeyboard,
Expand Down

0 comments on commit 89a61e0

Please sign in to comment.