Add feature flag for Projector custom thumbnail.

When the flag is on, Projector will try to load a thumbnail file from
Drive. Since it introduce another complex drive request, adding this
flag (enabled by default) as kill switch in case the extra call
introduce any issue.

Bug: b/199439541
Change-Id: I10ff96f3bd7508eb406c08ea3671ffc84215fc95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3579684
Reviewed-by: Zork <zork@chromium.org>
Commit-Queue: Li Lin <llin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#991141}
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc
index 6e25c9d..72315727 100644
--- a/ash/constants/ash_features.cc
+++ b/ash/constants/ash_features.cc
@@ -1152,6 +1152,10 @@
     "ProjectorTutorialVideoView",
     base::FEATURE_DISABLED_BY_DEFAULT);
 
+// Controls whether Projector use custom thumbnail in gallery page.
+const base::Feature kProjectorCustomThumbnail("kProjectorCustomThumbnail",
+                                              base::FEATURE_ENABLED_BY_DEFAULT);
+
 // Controls whether the quick dim prototype is enabled.
 const base::Feature kQuickDim{"QuickDim", base::FEATURE_DISABLED_BY_DEFAULT};
 
@@ -2007,6 +2011,10 @@
   return base::FeatureList::IsEnabled(kProjectorTutorialVideoView);
 }
 
+bool IsProjectorCustomThumbnailEnabled() {
+  return base::FeatureList::IsEnabled(kProjectorCustomThumbnail);
+}
+
 bool IsQuickDimEnabled() {
   return base::FeatureList::IsEnabled(kQuickDim) && ash::switches::HasHps();
 }
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h
index 6d5a66c..21a2050 100644
--- a/ash/constants/ash_features.h
+++ b/ash/constants/ash_features.h
@@ -448,6 +448,8 @@
 COMPONENT_EXPORT(ASH_CONSTANTS)
 extern const base::Feature kProjectorTutorialVideoView;
 COMPONENT_EXPORT(ASH_CONSTANTS)
+extern const base::Feature kProjectorCustomThumbnail;
+COMPONENT_EXPORT(ASH_CONSTANTS)
 extern const base::Feature kQuickDim;
 COMPONENT_EXPORT(ASH_CONSTANTS)
 extern const base::Feature kQuickSettingsNetworkRevamp;
@@ -700,6 +702,7 @@
 COMPONENT_EXPORT(ASH_CONSTANTS) bool IsProjectorAppDebugMode();
 COMPONENT_EXPORT(ASH_CONSTANTS) bool IsProjectorExcludeTranscriptEnabled();
 COMPONENT_EXPORT(ASH_CONSTANTS) bool IsProjectorTutorialVideoViewEnabled();
+COMPONENT_EXPORT(ASH_CONSTANTS) bool IsProjectorCustomThumbnailEnabled();
 COMPONENT_EXPORT(ASH_CONSTANTS) bool IsQuickDimEnabled();
 COMPONENT_EXPORT(ASH_CONSTANTS)
 bool IsQuickSettingsNetworkRevampEnabled();
diff --git a/chrome/browser/ash/web_applications/projector_app/untrusted_projector_ui_config.cc b/chrome/browser/ash/web_applications/projector_app/untrusted_projector_ui_config.cc
index d2faa3b3..4f061b11 100644
--- a/chrome/browser/ash/web_applications/projector_app/untrusted_projector_ui_config.cc
+++ b/chrome/browser/ash/web_applications/projector_app/untrusted_projector_ui_config.cc
@@ -26,6 +26,8 @@
                      ash::features::IsProjectorExcludeTranscriptEnabled());
   source->AddBoolean("isTutorialVideoViewEnabled",
                      ash::features::IsProjectorTutorialVideoViewEnabled());
+  source->AddBoolean("isCustomThumbnailEnabled",
+                     ash::features::IsProjectorCustomThumbnailEnabled());
   source->AddString("appLocale", g_browser_process->GetApplicationLocale());
 }