[go: nahoru, domu]

Settings: Proactive Topics Blocking - string name changes

Bug: b:318016758
Change-Id: I9d1ae6c2c75ef3cf7d29455f0ce484e89eea7625
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5249873
Reviewed-by: Abe Boujane <boujane@google.com>
Commit-Queue: Jacob Stanley <jacobstanley@google.com>
Reviewed-by: John Lee <johntlee@chromium.org>
Reviewed-by: Andrey Zaytsev <andzaytsev@google.com>
Cr-Commit-Position: refs/heads/main@{#1255083}
diff --git a/chrome/browser/privacy_sandbox/android/java/res/xml/topics_preference_v2.xml b/chrome/browser/privacy_sandbox/android/java/res/xml/topics_preference_v2.xml
index 4f2ad53..079711f8 100644
--- a/chrome/browser/privacy_sandbox/android/java/res/xml/topics_preference_v2.xml
+++ b/chrome/browser/privacy_sandbox/android/java/res/xml/topics_preference_v2.xml
@@ -33,7 +33,7 @@
 
     <org.chromium.components.browser_ui.settings.TextMessagePreference
         android:key="topics_empty"
-        android:summary="@string/settings_topics_page_current_topics_description_empty_ptb" />
+        android:summary="@string/settings_topics_page_current_topics_description_empty_text_v2" />
 
     <org.chromium.components.browser_ui.settings.ChromeBasePreference
         android:key="blocked_topics"
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragment.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragment.java
index 360eca4..36dc1854 100644
--- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragment.java
+++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragment.java
@@ -112,7 +112,7 @@
             mBlockedTopicsCategory.setSummary(null);
             if (mBlockedTopicsCategory.getPreferenceCount() == 0)
                 mBlockedTopicsCategory.setSummary(
-                        R.string.settings_topics_page_blocked_topics_description_empty_ptb);
+                        R.string.settings_topics_page_blocked_topics_description_empty_text_v2);
             return;
         }
         mBlockedTopicsCategory.setSummary(
diff --git a/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_topics_subpage.html b/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_topics_subpage.html
index c81e4e5b..4fa1769 100644
--- a/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_topics_subpage.html
+++ b/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_topics_subpage.html
@@ -140,12 +140,12 @@
               class="topics-empty-text-v2"
               hidden="[[!isTopicsListEmptyV2_(topicsList_.length,
               shouldShowV2_)]]">
-            <span id="currentTopicsDescriptionEmptyTopText">
-              $i18n{topicsPageCurrentTopicsDescriptionEmptyTopText}
+            <span id="currentTopicsDescriptionEmptyTextHeading">
+              $i18n{topicsPageCurrentTopicsDescriptionEmptyTextHeading}
             </span>
-            <span id="currentTopicsDescriptionEmptyBottomText"
+            <span id="currentTopicsDescriptionEmptyTextV2"
                 class="cr-secondary-text">
-              $i18n{topicsPageCurrentTopicsDescriptionEmptyPtb}
+              $i18n{topicsPageCurrentTopicsDescriptionEmptyTextV2}
             </span>
           </div>
         </template>
@@ -175,12 +175,12 @@
         class="topics-empty-text-v2"
         hidden="[[!isBlockedTopicsListEmptyV2_(blockedTopicsList_.length,
         shouldShowV2_)]]">
-      <span id="blockedTopicsDescriptionEmptyTopText">
-          $i18n{topicsPageBlockedTopicsDescriptionEmptyTopText}
+      <span id="blockedTopicsDescriptionEmptyTextHeading">
+          $i18n{topicsPageBlockedTopicsDescriptionEmptyTextHeading}
       </span>
-      <span id="blockedTopicsDescriptionEmptyBottomText"
+      <span id="blockedTopicsDescriptionEmptyTextV2"
           class="cr-secondary-text">
-        $i18n{topicsPageBlockedTopicsDescriptionEmptyPtb}
+        $i18n{topicsPageBlockedTopicsDescriptionEmptyTextV2}
       </span>
     </div>
     <div id="blockedTopicsList" role="region"
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
index 75228522..9ad6770a 100644
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1981,14 +1981,14 @@
        IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_DISABLED},
       {"topicsPageCurrentTopicsDescriptionEmpty",
        IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_EMPTY},
-      {"topicsPageCurrentTopicsDescriptionEmptyTopText",
-       IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_EMPTY_TOP_TEXT},
-      {"topicsPageCurrentTopicsDescriptionEmptyPtb",
-       IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_EMPTY_PTB},
-      {"topicsPageBlockedTopicsDescriptionEmptyTopText",
-       IDS_SETTINGS_TOPICS_PAGE_BLOCKED_TOPICS_DESCRIPTION_EMPTY_TOP_TEXT},
-      {"topicsPageBlockedTopicsDescriptionEmptyPtb",
-       IDS_SETTINGS_TOPICS_PAGE_BLOCKED_TOPICS_DESCRIPTION_EMPTY_PTB},
+      {"topicsPageCurrentTopicsDescriptionEmptyTextHeading",
+       IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_EMPTY_TEXT_HEADING},
+      {"topicsPageCurrentTopicsDescriptionEmptyTextV2",
+       IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_EMPTY_TEXT_V2},
+      {"topicsPageBlockedTopicsDescriptionEmptyTextHeading",
+       IDS_SETTINGS_TOPICS_PAGE_BLOCKED_TOPICS_DESCRIPTION_EMPTY_TEXT_HEADING},
+      {"topicsPageBlockedTopicsDescriptionEmptyTextV2",
+       IDS_SETTINGS_TOPICS_PAGE_BLOCKED_TOPICS_DESCRIPTION_EMPTY_TEXT_V2},
       {"topicsPageBlockTopic", IDS_SETTINGS_TOPICS_PAGE_BLOCK_TOPIC},
       {"topicsPageBlockTopicA11yLabel",
        IDS_SETTINGS_TOPICS_PAGE_BLOCK_TOPIC_A11Y_LABEL},
diff --git a/chrome/test/data/webui/settings/privacy_sandbox_page_test.ts b/chrome/test/data/webui/settings/privacy_sandbox_page_test.ts
index 81856e11..e34a772 100644
--- a/chrome/test/data/webui/settings/privacy_sandbox_page_test.ts
+++ b/chrome/test/data/webui/settings/privacy_sandbox_page_test.ts
@@ -763,13 +763,13 @@
       '#currentTopicsHeading',
       '#currentTopicsDescription',
       '#currentTopicsDescriptionEmpty',
-      '#currentTopicsDescriptionEmptyTopText',
-      '#currentTopicsDescriptionEmptyBottomText',
+      '#currentTopicsDescriptionEmptyTextHeading',
+      '#currentTopicsDescriptionEmptyTextV2',
       '#currentTopicsDescriptionDisabled',
       '#blockedTopicsRow',
       '#blockedTopicsDescriptionV2',
-      '#blockedTopicsDescriptionEmptyTopText',
-      '#blockedTopicsDescriptionEmptyBottomText',
+      '#blockedTopicsDescriptionEmptyTextHeading',
+      '#blockedTopicsDescriptionEmptyTextV2',
       '#blockedTopicsList',
       '#manageTopicsSection',
     ];
@@ -808,16 +808,16 @@
     // Non V2 blocked topics description should not be visible
     assertFalse(isChildVisible(page, '#blockedTopicsDescription'));
     // The blocked topic list is NOT empty after re-enabling the toggle
-    assertFalse(isChildVisible(page, '#blockedTopicsDescriptionEmptyTopText'));
     assertFalse(
-        isChildVisible(page, '#blockedTopicsDescriptionEmptyBottomText'));
+        isChildVisible(page, '#blockedTopicsDescriptionEmptyTextHeading'));
+    assertFalse(isChildVisible(page, '#blockedTopicsDescriptionEmptyTextV2'));
     // Assert V2 Layout for ids to be shown.
     const idsToBeShown = [
       '#currentTopicsSection',
       '#currentTopicsHeading',
       '#currentTopicsDescription',
-      '#currentTopicsDescriptionEmptyTopText',
-      '#currentTopicsDescriptionEmptyBottomText',
+      '#currentTopicsDescriptionEmptyTextHeading',
+      '#currentTopicsDescriptionEmptyTextV2',
       '#blockedTopicsRow',
       '#blockedTopicsDescriptionV2',
       '#blockedTopicsList',
@@ -835,9 +835,9 @@
         loadTimeData.getString('topicsPageToggleSubLabelV2'),
         page.$.topicsToggle.subLabel);
     assertFalse(isChildVisible(page, '#currentTopicsDescriptionEmpty'));
-    assertFalse(isChildVisible(page, '#currentTopicsDescriptionEmptyTopText'));
     assertFalse(
-        isChildVisible(page, '#currentTopicsDescriptionEmptyBottomText'));
+        isChildVisible(page, '#currentTopicsDescriptionEmptyTextHeading'));
+    assertFalse(isChildVisible(page, '#currentTopicsDescriptionEmptyTextV2'));
     assertFalse(isChildVisible(page, '#currentTopicsDescriptionDisabled'));
     const blockedTopicsRow =
         page.shadowRoot!.querySelector<HTMLElement>('#blockedTopicsRow');
@@ -849,9 +849,9 @@
     // Non V2 blocked topics description should not be visible
     assertFalse(isChildVisible(page, '#blockedTopicsDescription'));
     // Blocked topics list is not empty
-    assertFalse(isChildVisible(page, '#blockedTopicsDescriptionEmptyTopText'));
     assertFalse(
-        isChildVisible(page, '#blockedTopicsDescriptionEmptyBottomText'));
+        isChildVisible(page, '#blockedTopicsDescriptionEmptyTextHeading'));
+    assertFalse(isChildVisible(page, '#blockedTopicsDescriptionEmptyTextV2'));
     // Assert V2 Layout for ids to be shown.
     const idsToBeShown = [
       '#currentTopicsSection',
@@ -887,14 +887,14 @@
       '#currentTopicsHeading',
       '#currentTopicsDescription',
       '#currentTopicsDescriptionEmpty',
-      '#currentTopicsDescriptionEmptyTopText',
-      '#currentTopicsDescriptionEmptyBottomText',
+      '#currentTopicsDescriptionEmptyTextHeading',
+      '#currentTopicsDescriptionEmptyTextV2',
       '#currentTopicsDescriptionDisabled',
       '#blockedTopicsRow',
       '#blockedTopicsDescription',
       '#blockedTopicsDescriptionV2',
-      '#blockedTopicsDescriptionEmptyTopText',
-      '#blockedTopicsDescriptionEmptyBottomText',
+      '#blockedTopicsDescriptionEmptyTextHeading',
+      '#blockedTopicsDescriptionEmptyTextV2',
       '#blockedTopicsList',
       '#manageTopicsSection',
     ];
@@ -933,9 +933,9 @@
         currentTopicsSection.querySelectorAll('privacy-sandbox-interest-item');
     assertEquals(3, currentTopics.length);
     assertFalse(isVisible(currentTopicsSection.querySelector(
-        '#currentTopicsDescriptionEmptyTopText')));
+        '#currentTopicsDescriptionEmptyTextHeading')));
     assertFalse(isVisible(currentTopicsSection.querySelector(
-        '#currentTopicsDescriptionEmptyBottomText')));
+        '#currentTopicsDescriptionEmptyTextV2')));
     // TODO(b/322845275) - When testing privacy-sandbox-interest-item, add tests
     // to assert that the DOM is actually displaying correctly.
     assertEquals(
@@ -1041,9 +1041,9 @@
     metricsBrowserProxy.resetResolver('recordAction');
     await testPrivacySandboxBrowserProxy.whenCalled('setTopicAllowed');
     assertTrue(isVisible(currentTopicsSection.querySelector(
-        '#currentTopicsDescriptionEmptyTopText')));
+        '#currentTopicsDescriptionEmptyTextHeading')));
     assertTrue(isVisible(currentTopicsSection.querySelector(
-        '#currentTopicsDescriptionEmptyBottomText')));
+        '#currentTopicsDescriptionEmptyTextV2')));
 
     // Check that the focus is not lost after blocking the last item.
     await waitAfterNextRender(page);
@@ -1115,9 +1115,9 @@
     await waitAfterNextRender(page);
     assertEquals(blockedTopicsRow, page.shadowRoot!.activeElement);
     // Check that blocked topics empty text appears
-    assertTrue(isChildVisible(page, '#blockedTopicsDescriptionEmptyTopText'));
     assertTrue(
-        isChildVisible(page, '#blockedTopicsDescriptionEmptyBottomText'));
+        isChildVisible(page, '#blockedTopicsDescriptionEmptyTextHeading'));
+    assertTrue(isChildVisible(page, '#blockedTopicsDescriptionEmptyTextV2'));
   });
 
   test('topicsManaged', async function() {
diff --git a/components/privacy_sandbox_strings.grdp b/components/privacy_sandbox_strings.grdp
index bfee364..534ef37 100644
--- a/components/privacy_sandbox_strings.grdp
+++ b/components/privacy_sandbox_strings.grdp
@@ -200,16 +200,16 @@
   <message name="IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_EMPTY" desc="A description that appear beneath the 'Your topics' title. This setting could be on but no topics appear in the list. This text explains why." formatter_data="android_java">
     No topics to show right now
   </message>
-  <message name="IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_EMPTY_PTB" desc="A description that appear beneath the 'Active topics' title. The ad topics setting could be on but no topics appears in the list. This is part of the text that explains why. There are two strings stating that there are no current active topics. This is the bottom text." translateable="false" formatter_data="android_java">
+  <message name="IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_EMPTY_TEXT_V2" desc="A description that appear beneath the 'Active topics' title. The ad topics setting could be on but no topics appears in the list. This is part of the text that explains why." translateable="false" formatter_data="android_java">
     You don't have any active topics yet
   </message>
-  <message name="IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_EMPTY_TOP_TEXT" desc="A description that appear beneath the 'Active topics' title. The ad topics setting could be on but no topics appears in the list. This is part of the text that explains why. There are two strings stating that there are no current active topics. This is the top text." translateable="false">
+  <message name="IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION_EMPTY_TEXT_HEADING" desc="A description that appear beneath the 'Active topics' title. The ad topics setting could be on but no topics appears in the list. This is part of the text that explains why." translateable="false">
     No active topics
   </message>
-  <message name="IDS_SETTINGS_TOPICS_PAGE_BLOCKED_TOPICS_DESCRIPTION_EMPTY_PTB" desc="A description that appear beneath the 'Blocked topics' title. The ad topics setting could be on but no topics appears in the list. This is part of the text that explains why. There are two strings stating that there are no current blocked topics. This is the bottom text." translateable="false" formatter_data="android_java">
+  <message name="IDS_SETTINGS_TOPICS_PAGE_BLOCKED_TOPICS_DESCRIPTION_EMPTY_TEXT_V2" desc="A description that appear beneath the 'Blocked topics' title. The ad topics setting could be on but no topics appears in the list. This is part of the text that explains why." translateable="false" formatter_data="android_java">
     You haven't blocked any topics
   </message>
-  <message name="IDS_SETTINGS_TOPICS_PAGE_BLOCKED_TOPICS_DESCRIPTION_EMPTY_TOP_TEXT" desc="A description that appear beneath the 'Blocked topics' title. The ad topics setting could be on but no topics appears in the list. This is part of the text that explains why. There are two strings stating that there are no current blocked topics. This is the top text." translateable="false">
+  <message name="IDS_SETTINGS_TOPICS_PAGE_BLOCKED_TOPICS_DESCRIPTION_EMPTY_TEXT_HEADING" desc="A description that appear beneath the 'Blocked topics' title. The ad topics setting could be on but no topics appears in the list. This is part of the text that explains why." translateable="false">
     No blocked topics
   </message>
   <message name="IDS_SETTINGS_TOPICS_PAGE_BLOCK_TOPIC" desc="A button associated with each of the user's topics. If the user clicks 'Block', that topic will get moved to the 'Topics you blocked' page.">