capture_mode_polish: Clean up Selfie Cam feature and flag

Fixed: 1347276
Test: Existing tests
Change-Id: Icf48c83aa854ad085c4a7a7ed816e69bbede7bb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3785433
Reviewed-by: James Cook <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Commit-Queue: Ahmed Fakhry <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1028382}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index bc83ff48..a8b9341 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -3552,9 +3552,6 @@
     {"ash-bento-bar", flag_descriptions::kBentoBarName,
      flag_descriptions::kBentoBarDescription, kOsCrOS,
      FEATURE_VALUE_TYPE(ash::features::kBentoBar)},
-    {"ash-capture-mode-selfie-cam", flag_descriptions::kCaptureSelfieCamName,
-     flag_descriptions::kCaptureSelfieCamDescription, kOsCrOS,
-     FEATURE_VALUE_TYPE(ash::features::kCaptureModeSelfieCamera)},
     {"ash-drag-window-to-new-desk", flag_descriptions::kDragWindowToNewDeskName,
      flag_descriptions::kDragWindowToNewDeskDescription, kOsCrOS,
      FEATURE_VALUE_TYPE(ash::features::kDragWindowToNewDesk)},
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 326d75e..cd19d759 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -281,11 +281,6 @@
     "expiry_milestone": 110
   },
   {
-    "name": "ash-capture-mode-selfie-cam",
-    "owners": [ "afakhry", "gzadina" ],
-    "expiry_milestone": 112
-  },
-  {
     "name": "ash-debug-shortcuts",
     "owners": [ "//ash/OWNERS" ],
     // Used by developers for debugging and to dump extra information to logs
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 2f96a3b..4729bb1 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -4563,11 +4563,6 @@
     "the system logs, where they are potentially visible to all users of the "
     "device.";
 
-const char kCaptureSelfieCamName[] = "Enable selfie camera in screen capture";
-const char kCaptureSelfieCamDescription[] =
-    "Enables the ability to record the selected camera feed along with screen "
-    "recordings for personalized demos and more.";
-
 const char kDefaultLinkCapturingInBrowserName[] =
     "Default link capturing in the browser";
 const char kDefaultLinkCapturingInBrowserDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 4f84c1a..40b4e2d 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -2611,9 +2611,6 @@
 extern const char kCalendarModelDebugModeName[];
 extern const char kCalendarModelDebugModeDescription[];
 
-extern const char kCaptureSelfieCamName[];
-extern const char kCaptureSelfieCamDescription[];
-
 extern const char kDefaultLinkCapturingInBrowserName[];
 extern const char kDefaultLinkCapturingInBrowserDescription[];
 
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 66c6b60a..fee3f0c 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -529,6 +529,15 @@
 // Deprecated 08/2021.
 const char kAccountManagerNumTimesMigrationRanSuccessfully[] =
     "account_manager.num_times_migration_ran_successfully";
+
+// Deprecated 07/2022.
+// The name of a boolean pref that determines whether we can show the folder
+// selection user nudge for the screen capture tool. When this pref is false, it
+// means that we showed the nudge at some point and the user interacted with the
+// capture mode session UI in such a way that the nudge no longer needs to be
+// displayed again.
+constexpr char kCanShowFolderSelectionNudge[] =
+    "ash.capture_mode.can_show_folder_selection_nudge";
 #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 #if !BUILDFLAG(IS_ANDROID)
@@ -855,6 +864,8 @@
 #if BUILDFLAG(IS_CHROMEOS_ASH)
   registry->RegisterIntegerPref(kAccountManagerNumTimesMigrationRanSuccessfully,
                                 0);
+  registry->RegisterBooleanPref(kCanShowFolderSelectionNudge,
+                                /*default_value=*/true);
   ash::HelpAppNotificationController::RegisterObsoletePrefsForMigration(
       registry);
   registry->RegisterBooleanPref(kHasCameraAppMigratedToSWA, false);
@@ -1831,6 +1842,8 @@
 #if BUILDFLAG(IS_CHROMEOS_ASH)
   // Added 08/2021.
   profile_prefs->ClearPref(kAccountManagerNumTimesMigrationRanSuccessfully);
+  // Added 07/2022.
+  profile_prefs->ClearPref(kCanShowFolderSelectionNudge);
 #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/ui/ash/capture_mode/capture_mode_browsertest.cc b/chrome/browser/ui/ash/capture_mode/capture_mode_browsertest.cc
index c896d34..50edaf3 100644
--- a/chrome/browser/ui/ash/capture_mode/capture_mode_browsertest.cc
+++ b/chrome/browser/ui/ash/capture_mode/capture_mode_browsertest.cc
@@ -768,12 +768,6 @@
     command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream);
   }
 
-  void SetUp() override {
-    scoped_feature_list_.InitAndEnableFeature(
-        ash::features::kCaptureModeSelfieCamera);
-    InProcessBrowserTest::SetUp();
-  }
-
   void SetUpOnMainThread() override {
     ash::CaptureModeTestApi test_api;
     ASSERT_EQ(1u, test_api.GetNumberOfAvailableCameras());
@@ -793,9 +787,6 @@
       loop.Run();
     }
   }
-
- private:
-  base::test::ScopedFeatureList scoped_feature_list_;
 };
 
 IN_PROC_BROWSER_TEST_F(CaptureModeCameraBrowserTests, VerifyFrames) {