[GID] Introduce feature flag for Identity Disc

BUG=958982
[email protected]

Change-Id: I3a5097857060582830a544f4f2cc68dbd3b5592a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1600391
Reviewed-by: Filip Gorski <[email protected]>
Commit-Queue: Pavel Yatsuk <[email protected]>
Cr-Commit-Position: refs/heads/master@{#657890}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
index c858161..44d465a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
@@ -243,6 +243,7 @@
     public static final String HOME_PAGE_BUTTON_FORCE_ENABLED = "HomePageButtonForceEnabled";
     public static final String HOMEPAGE_TILE = "HomepageTile";
     public static final String HORIZONTAL_TAB_SWITCHER_ANDROID = "HorizontalTabSwitcherAndroid";
+    public static final String IDENTITY_DISC = "IdentityDisc";
     public static final String IMMERSIVE_UI_MODE = "ImmersiveUiMode";
     public static final String INCOGNITO_STRINGS = "IncognitoStrings";
     public static final String INLINE_UPDATE_FLOW = "InlineUpdateFlow";
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 70f474e..b5fba2a 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -3683,6 +3683,9 @@
      flag_descriptions::kMobileIdentityConsistencyName,
      flag_descriptions::kMobileIdentityConsistencyDescription, kOsAndroid,
      FEATURE_VALUE_TYPE(signin::kMiceFeature)},
+    {"identity-disc", flag_descriptions::kIdentityDiscName,
+     flag_descriptions::kIdentityDiscDescription, kOsAndroid,
+     FEATURE_VALUE_TYPE(chrome::android::kIdentityDisc)},
 #endif  // defined(OS_ANDROID)
 
     {"autofill-use-improved-label-disambiguation",
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc
index 9a1bb72d..6615312 100644
--- a/chrome/browser/android/chrome_feature_list.cc
+++ b/chrome/browser/android/chrome_feature_list.cc
@@ -141,6 +141,7 @@
     &kHomePageButtonForceEnabled,
     &kHomepageTile,
     &kHorizontalTabSwitcherAndroid,
+    &kIdentityDisc,
     &kImmersiveUiMode,
     &kImprovedA2HS,
     &kInlineUpdateFlow,
@@ -407,6 +408,9 @@
 const base::Feature kHorizontalTabSwitcherAndroid{
     "HorizontalTabSwitcherAndroid", base::FEATURE_DISABLED_BY_DEFAULT};
 
+const base::Feature kIdentityDisc{"IdentityDisc",
+                                  base::FEATURE_DISABLED_BY_DEFAULT};
+
 // Makes "Add to Home screen" in the app menu generate an APK for the shortcut
 // URL which opens Chrome in fullscreen.
 // This feature is kept around so that we have a kill-switch in case of server
diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h
index 515e35c..1118d7c 100644
--- a/chrome/browser/android/chrome_feature_list.h
+++ b/chrome/browser/android/chrome_feature_list.h
@@ -72,6 +72,7 @@
 extern const base::Feature kHomePageButtonForceEnabled;
 extern const base::Feature kHomepageTile;
 extern const base::Feature kHorizontalTabSwitcherAndroid;
+extern const base::Feature kIdentityDisc;
 extern const base::Feature kImmersiveUiMode;
 extern const base::Feature kImprovedA2HS;
 extern const base::Feature kInlineUpdateFlow;
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 5c156231..f77b22f 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -1173,6 +1173,11 @@
     "expiry_milestone": 80
   },
   {
+    "name": "identity-disc",
+    "owners": ["//chrome/android/java/src/org/chromium/chrome/browser/toolbar/OWNERS"],
+    "expiry_milestone": 78
+  },
+  {
     "name": "enable-implicit-root-scroller",
     "owners": [ "bokan", "input-dev" ],
     "expiry_milestone": 75
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index f3a7941..8202b61 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -2323,6 +2323,10 @@
     "When NTPButton is enabled, the first tile of the Suggested Tiles will be "
     "used for homepage. It will not have an effect when NTPButton is disabled.";
 
+const char kIdentityDiscName[] = "Identity Disc";
+const char kIdentityDiscDescription[] =
+    "Enables Identity Disc, profile avatar icon button in toolbar.";
+
 const char kIncognitoStringsName[] = "Alternate incognito strings";
 const char kIncognitoStringsDescription[] =
     "Show alternate incognito strings if enabled.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 000d375..c357d8d 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1396,6 +1396,9 @@
 extern const char kHomepageTileName[];
 extern const char kHomepageTileDescription[];
 
+extern const char kIdentityDiscName[];
+extern const char kIdentityDiscDescription[];
+
 extern const char kIncognitoStringsName[];
 extern const char kIncognitoStringsDescription[];
 
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index be7dd31..7c038c93 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -34768,6 +34768,7 @@
       label="SyncPseudoUSSHistoryDeleteDirectives:disabled"/>
   <int value="1260186484" label="spurious-power-button-screen-accel"/>
   <int value="1261713150" label="ChromeHomeOptOutSnackbar:disabled"/>
+  <int value="1266156008" label="IdentityDisc:disabled"/>
   <int value="1266525177"
       label="AutofillUpstreamUseGooglePayOnAndroidBranding:disabled"/>
   <int value="1266886673" label="delay-reload-stop-button-change"/>
@@ -35122,6 +35123,7 @@
   <int value="1814671708" label="disable-password-manager-reauthentication"/>
   <int value="1816843861" label="ServiceWorkerServicification:enabled"/>
   <int value="1817312143" label="num-raster-threads"/>
+  <int value="1818829958" label="IdentityDisc:enabled"/>
   <int value="1819256299" label="disable-webrtc-hw-decoding"/>
   <int value="1819536169" label="disable-cast-streaming-hw-encoding"/>
   <int value="1820317896" label="NTPShowGoogleGInOmnibox:disabled"/>