Add a feature flag for ARC Game Mode

TEST=out/Default/unit_tests --gtest_filter="AboutFlags*"

Bug: b/228405479
Change-Id: Ia1fdcc435875a050e6a42640d1b0b50b790a4c3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3724351
Reviewed-by: Satoshi Niwa <niwa@chromium.org>
Reviewed-by: Yusuke Sato <yusukes@chromium.org>
Commit-Queue: Matthew DeVore <matvore@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1018687}
diff --git a/ash/components/arc/arc_features.cc b/ash/components/arc/arc_features.cc
index bcdd13b..9a7097c 100644
--- a/ash/components/arc/arc_features.cc
+++ b/ash/components/arc/arc_features.cc
@@ -76,6 +76,11 @@
 const base::Feature kFilePickerExperimentFeature{
     "ArcFilePickerExperiment", base::FEATURE_ENABLED_BY_DEFAULT};
 
+// Controls whether ARCVM can request resourced make more resources available
+// for a currently-active ARCVM game.
+const base::Feature kGameModeFeature{
+    "ArcGameModeFeature", base::FEATURE_DISABLED_BY_DEFAULT};
+
 // Controls whether the guest zram is enabled. This is only for ARCVM.
 const base::Feature kGuestZram{"ArcGuestZram",
                                base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/ash/components/arc/arc_features.h b/ash/components/arc/arc_features.h
index d671528..4fd37519 100644
--- a/ash/components/arc/arc_features.h
+++ b/ash/components/arc/arc_features.h
@@ -26,6 +26,7 @@
 extern const base::Feature kEnableUsap;
 extern const base::Feature kEnableVirtioBlkForData;
 extern const base::Feature kFilePickerExperimentFeature;
+extern const base::Feature kGameModeFeature;
 extern const base::Feature kGmsCoreLowMemoryKillerProtection;
 extern const base::Feature kGuestZram;
 extern const base::FeatureParam<int> kGuestZramSize;
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index d563b4e8..404eedd8 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4760,6 +4760,10 @@
      flag_descriptions::kArcFilePickerExperimentName,
      flag_descriptions::kArcFilePickerExperimentDescription, kOsCrOS,
      FEATURE_VALUE_TYPE(arc::kFilePickerExperimentFeature)},
+    {"arc-game-mode",
+     flag_descriptions::kArcGameModeName,
+     flag_descriptions::kArcGameModeDescription, kOsCrOS,
+     FEATURE_VALUE_TYPE(arc::kGameModeFeature)},
     {"arc-keyboard-shortcut-helper-integration",
      flag_descriptions::kArcKeyboardShortcutHelperIntegrationName,
      flag_descriptions::kArcKeyboardShortcutHelperIntegrationDescription,
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 59b9277..9f58d51 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -216,6 +216,11 @@
     "expiry_milestone": 110
   },
   {
+    "name": "arc-game-mode",
+    "owners": [ "matvore", "niwa" ],
+    "expiry_milestone": 115
+  },
+  {
     "name": "arc-input-overlay",
     "owners": [ "cuicuiruan@google.com", "arc-gaming@google.com" ],
     "expiry_milestone": 110
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index fc82837..7be913c 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -4275,6 +4275,12 @@
 const char kArcFilePickerExperimentDescription[] =
     "Enables using ChromeOS file picker in ARC.";
 
+const char kArcGameModeName[] =
+    "Enable Game Mode for ARC";
+const char kArcGameModeDescription[] =
+    "ARC Fullscreen Games will request accomodation from ChromeOS for "
+    "sustained performance.";
+
 const char kArcKeyboardShortcutHelperIntegrationName[] =
     "Enable keyboard shortcut helper integration for ARC";
 const char kArcKeyboardShortcutHelperIntegrationDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 952a2c07..3aa662a 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -2449,6 +2449,9 @@
 extern const char kArcFilePickerExperimentName[];
 extern const char kArcFilePickerExperimentDescription[];
 
+extern const char kArcGameModeName[];
+extern const char kArcGameModeDescription[];
+
 extern const char kArcKeyboardShortcutHelperIntegrationName[];
 extern const char kArcKeyboardShortcutHelperIntegrationDescription[];
 
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index e4dae0b..f39908a 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -58382,6 +58382,7 @@
   <int value="24332306" label="ButtonARCNetworkDiagnostics:disabled"/>
   <int value="26875005" label="disable-explicit-dma-fences"/>
   <int value="26945819" label="EnhancedDeskAnimations:disabled"/>
+  <int value="27442980" label="ArcGameModeFeature:enabled"/>
   <int value="27507364" label="apps-keep-chrome-alive"/>
   <int value="27632363" label="JourneysOmniboxHistoryClusterProvider:enabled"/>
   <int value="29212695" label="OfflineIndicator:enabled"/>
@@ -60516,6 +60517,7 @@
   <int value="1413948819" label="NupPrinting:enabled"/>
   <int value="1414918327" label="enable-accelerated-video-decode"/>
   <int value="1416592483" label="ash-enable-mirrored-screen"/>
+  <int value="1416970206" label="ArcGameModeFeature:disabled"/>
   <int value="1418054870" label="SpecialLocale:enabled"/>
   <int value="1419806576" label="OsFeedback:enabled"/>
   <int value="1419984081"