Commit 35829175 authored by Pavel Yatsuk's avatar Pavel Yatsuk Committed by Commit Bot

[Messages] Add flags for infrastructure and passwords infobars

This CL adds feature flags and about:flags entries for a couple of
flags:
- MessagesForAndroidInfrastructure will control initialization of
  infrastructure classes (MessageQueueManager, etc.)
- MessagesForAndroidPasswordsName will control whether save/update
  password uses Infobars or Messages UI.

BUG=1123947
R=lazzzis@chromium.org

Change-Id: I4b3e3920d2909f8e6144cc197d8fddc029356f86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388949Reviewed-by: default avatarLijin Shen <lazzzis@google.com>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Pavel Yatsuk <pavely@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804317}
parent 761cb64c
...@@ -3005,6 +3005,7 @@ static_library("browser") { ...@@ -3005,6 +3005,7 @@ static_library("browser") {
"//components/javascript_dialogs/android:jni_headers", "//components/javascript_dialogs/android:jni_headers",
"//components/language/android:language_bridge", "//components/language/android:language_bridge",
"//components/location/android:settings", "//components/location/android:settings",
"//components/messages/android:feature_flags",
"//components/module_installer/android:native", "//components/module_installer/android:native",
"//components/omnibox/browser", "//components/omnibox/browser",
"//components/page_info/android", "//components/page_info/android",
......
...@@ -162,6 +162,7 @@ include_rules = [ ...@@ -162,6 +162,7 @@ include_rules = [
"+components/lookalikes/core", "+components/lookalikes/core",
"+components/login", "+components/login",
"+components/media_message_center", "+components/media_message_center",
"+components/messages/android",
"+components/metal_util", "+components/metal_util",
"+components/metrics", "+components/metrics",
"+components/metrics_services_manager", "+components/metrics_services_manager",
......
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
#include "components/invalidation/impl/invalidation_switches.h" #include "components/invalidation/impl/invalidation_switches.h"
#include "components/language/core/common/language_experiments.h" #include "components/language/core/common/language_experiments.h"
#include "components/lookalikes/core/features.h" #include "components/lookalikes/core/features.h"
#include "components/messages/android/messages_feature.h"
#include "components/nacl/common/buildflags.h" #include "components/nacl/common/buildflags.h"
#include "components/nacl/common/nacl_switches.h" #include "components/nacl/common/nacl_switches.h"
#include "components/network_session_configurator/common/network_features.h" #include "components/network_session_configurator/common/network_features.h"
...@@ -6419,6 +6420,18 @@ const FeatureEntry kFeatureEntries[] = { ...@@ -6419,6 +6420,18 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(media::kVideoToolboxVp9Decoding)}, FEATURE_VALUE_TYPE(media::kVideoToolboxVp9Decoding)},
#endif #endif
#if defined(OS_ANDROID)
{"messages-for-android-infrastructure",
flag_descriptions::kMessagesForAndroidInfrastructureName,
flag_descriptions::kMessagesForAndroidInfrastructureDescription,
kOsAndroid,
FEATURE_VALUE_TYPE(messages::kMessagesForAndroidInfrastructure)},
{"messages-for-android-passwords",
flag_descriptions::kMessagesForAndroidPasswordsName,
flag_descriptions::kMessagesForAndroidPasswordsDescription, kOsAndroid,
FEATURE_VALUE_TYPE(messages::kMessagesForAndroidPasswords)},
#endif
// NOTE: Adding a new flag requires adding a corresponding entry to enum // NOTE: Adding a new flag requires adding a corresponding entry to enum
// "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
// Histograms" in tools/metrics/histograms/README.md (run the // Histograms" in tools/metrics/histograms/README.md (run the
......
...@@ -3050,6 +3050,16 @@ ...@@ -3050,6 +3050,16 @@
"owners": [ "sczs", "bling-flags" ], "owners": [ "sczs", "bling-flags" ],
"expiry_milestone": 85 "expiry_milestone": 85
}, },
{
"name": "messages-for-android-infrastructure",
"owners": [ "pavely", "lazzzis" ],
"expiry_milestone": 95
},
{
"name": "messages-for-android-passwords",
"owners": [ "pavely", "lazzzis" ],
"expiry_milestone": 95
},
{ {
"name": "messages-save-card-infobar", "name": "messages-save-card-infobar",
"owners": [ "sczs", "thegreenfrog", "bling-flags" ], "owners": [ "sczs", "thegreenfrog", "bling-flags" ],
......
...@@ -2848,6 +2848,13 @@ const char kInterestFeedFeedbackDescription[] = ...@@ -2848,6 +2848,13 @@ const char kInterestFeedFeedbackDescription[] =
"Allow the user to provide feedback from a feed card."; "Allow the user to provide feedback from a feed card.";
const char kInterestFeedFeedbackName[] = "Interest Feed Feedback"; const char kInterestFeedFeedbackName[] = "Interest Feed Feedback";
const char kMessagesForAndroidInfrastructureName[] = "Messages infrastructure";
const char kMessagesForAndroidInfrastructureDescription[] =
"When enabled, will initialize Messages UI infrastructure";
const char kMessagesForAndroidPasswordsName[] = "Passwords Messages UI";
const char kMessagesForAndroidPasswordsDescription[] =
"When enabled, password infobars will use the new Messages UI.";
const char kOfflineIndicatorAlwaysHttpProbeName[] = "Always http probe"; const char kOfflineIndicatorAlwaysHttpProbeName[] = "Always http probe";
const char kOfflineIndicatorAlwaysHttpProbeDescription[] = const char kOfflineIndicatorAlwaysHttpProbeDescription[] =
"Always do http probe to detect network connectivity for offline indicator " "Always do http probe to detect network connectivity for offline indicator "
......
...@@ -1648,6 +1648,12 @@ extern const char kInterestFeedV2Description[]; ...@@ -1648,6 +1648,12 @@ extern const char kInterestFeedV2Description[];
extern const char kInterestFeedFeedbackName[]; extern const char kInterestFeedFeedbackName[];
extern const char kInterestFeedFeedbackDescription[]; extern const char kInterestFeedFeedbackDescription[];
extern const char kMessagesForAndroidInfrastructureName[];
extern const char kMessagesForAndroidInfrastructureDescription[];
extern const char kMessagesForAndroidPasswordsName[];
extern const char kMessagesForAndroidPasswordsDescription[];
extern const char kOfflineIndicatorAlwaysHttpProbeName[]; extern const char kOfflineIndicatorAlwaysHttpProbeName[];
extern const char kOfflineIndicatorAlwaysHttpProbeDescription[]; extern const char kOfflineIndicatorAlwaysHttpProbeDescription[];
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "components/feed/feed_feature_list.h" #include "components/feed/feed_feature_list.h"
#include "components/invalidation/impl/invalidation_switches.h" #include "components/invalidation/impl/invalidation_switches.h"
#include "components/language/core/common/language_experiments.h" #include "components/language/core/common/language_experiments.h"
#include "components/messages/android/messages_feature.h"
#include "components/ntp_snippets/features.h" #include "components/ntp_snippets/features.h"
#include "components/ntp_tiles/features.h" #include "components/ntp_tiles/features.h"
#include "components/offline_pages/core/offline_page_feature.h" #include "components/offline_pages/core/offline_page_feature.h"
...@@ -227,6 +228,7 @@ const base::Feature* kFeaturesExposedToJava[] = { ...@@ -227,6 +228,7 @@ const base::Feature* kFeaturesExposedToJava[] = {
&paint_preview::kPaintPreviewShowOnStartup, &paint_preview::kPaintPreviewShowOnStartup,
&language::kDetailedLanguageSettings, &language::kDetailedLanguageSettings,
&language::kExplicitLanguageAsk, &language::kExplicitLanguageAsk,
&messages::kMessagesForAndroidInfrastructure,
&ntp_snippets::kArticleSuggestionsFeature, &ntp_snippets::kArticleSuggestionsFeature,
&offline_pages::kOfflineIndicatorFeature, &offline_pages::kOfflineIndicatorFeature,
&offline_pages::kOfflineIndicatorAlwaysHttpProbeFeature, &offline_pages::kOfflineIndicatorAlwaysHttpProbeFeature,
......
...@@ -315,10 +315,9 @@ public abstract class ChromeFeatureList { ...@@ -315,10 +315,9 @@ public abstract class ChromeFeatureList {
public static final String KITKAT_SUPPORTED = "KitKatSupported"; public static final String KITKAT_SUPPORTED = "KitKatSupported";
public static final String LOOKALIKE_NAVIGATION_URL_SUGGESTIONS_UI = public static final String LOOKALIKE_NAVIGATION_URL_SUGGESTIONS_UI =
"LookalikeUrlNavigationSuggestionsUI"; "LookalikeUrlNavigationSuggestionsUI";
public static final String SEARCH_ENGINE_PROMO_EXISTING_DEVICE =
"SearchEnginePromo.ExistingDevice";
public static final String SEARCH_ENGINE_PROMO_NEW_DEVICE = "SearchEnginePromo.NewDevice";
public static final String MARK_HTTP_AS = "MarkHttpAs"; public static final String MARK_HTTP_AS = "MarkHttpAs";
public static final String MESSAGES_FOR_ANDROID_INFRASTRUCTURE =
"MessagesForAndroidInfrastructure";
public static final String MOBILE_IDENTITY_CONSISTENCY = "MobileIdentityConsistency"; public static final String MOBILE_IDENTITY_CONSISTENCY = "MobileIdentityConsistency";
public static final String MODAL_PERMISSION_PROMPTS = "ModalPermissionPrompts"; public static final String MODAL_PERMISSION_PROMPTS = "ModalPermissionPrompts";
public static final String MODAL_PERMISSION_DIALOG_VIEW = "ModalPermissionDialogView"; public static final String MODAL_PERMISSION_DIALOG_VIEW = "ModalPermissionDialogView";
...@@ -366,6 +365,8 @@ public abstract class ChromeFeatureList { ...@@ -366,6 +365,8 @@ public abstract class ChromeFeatureList {
public static final String PORTALS_CROSS_ORIGIN = "PortalsCrossOrigin"; public static final String PORTALS_CROSS_ORIGIN = "PortalsCrossOrigin";
public static final String PREDICTIVE_PREFETCHING_ALLOWED_ON_ALL_CONNECTION_TYPES = public static final String PREDICTIVE_PREFETCHING_ALLOWED_ON_ALL_CONNECTION_TYPES =
"PredictivePrefetchingAllowedOnAllConnectionTypes"; "PredictivePrefetchingAllowedOnAllConnectionTypes";
public static final String PREFETCH_NOTIFICATION_SCHEDULING_INTEGRATION =
"PrefetchNotificationSchedulingIntegration";
public static final String PRIORITIZE_BOOTSTRAP_TASKS = "PrioritizeBootstrapTasks"; public static final String PRIORITIZE_BOOTSTRAP_TASKS = "PrioritizeBootstrapTasks";
public static final String PRIVACY_ELEVATED_ANDROID = "PrivacyElevatedAndroid"; public static final String PRIVACY_ELEVATED_ANDROID = "PrivacyElevatedAndroid";
public static final String PRIVACY_REORDERED_ANDROID = "PrivacyReorderedAndroid"; public static final String PRIVACY_REORDERED_ANDROID = "PrivacyReorderedAndroid";
...@@ -390,13 +391,20 @@ public abstract class ChromeFeatureList { ...@@ -390,13 +391,20 @@ public abstract class ChromeFeatureList {
public static final String SAFE_BROWSING_SECURITY_SECTION_UI = public static final String SAFE_BROWSING_SECURITY_SECTION_UI =
"SafeBrowsingSecuritySectionUIAndroid"; "SafeBrowsingSecuritySectionUIAndroid";
public static final String SAME_SITE_BY_DEFAULT_COOKIES = "SameSiteByDefaultCookies"; public static final String SAME_SITE_BY_DEFAULT_COOKIES = "SameSiteByDefaultCookies";
public static final String SEARCH_ENGINE_PROMO_EXISTING_DEVICE =
"SearchEnginePromo.ExistingDevice";
public static final String SEARCH_ENGINE_PROMO_NEW_DEVICE = "SearchEnginePromo.NewDevice";
public static final String SEND_TAB_TO_SELF = "SyncSendTabToSelf"; public static final String SEND_TAB_TO_SELF = "SyncSendTabToSelf";
public static final String SERVICE_MANAGER_FOR_BACKGROUND_PREFETCH =
"ServiceManagerForBackgroundPrefetch";
public static final String SERVICE_MANAGER_FOR_DOWNLOAD = "ServiceManagerForDownload"; public static final String SERVICE_MANAGER_FOR_DOWNLOAD = "ServiceManagerForDownload";
public static final String SHARE_BUTTON_IN_TOP_TOOLBAR = "ShareButtonInTopToolbar"; public static final String SHARE_BUTTON_IN_TOP_TOOLBAR = "ShareButtonInTopToolbar";
public static final String SHARED_CLIPBOARD_UI = "SharedClipboardUI"; public static final String SHARED_CLIPBOARD_UI = "SharedClipboardUI";
public static final String SHARING_QR_CODE_ANDROID = "SharingQrCodeAndroid"; public static final String SHARING_QR_CODE_ANDROID = "SharingQrCodeAndroid";
public static final String SHOW_TRUSTED_PUBLISHER_URL = "ShowTrustedPublisherURL"; public static final String SHOW_TRUSTED_PUBLISHER_URL = "ShowTrustedPublisherURL";
public static final String SPANNABLE_INLINE_AUTOCOMPLETE = "SpannableInlineAutocomplete"; public static final String SPANNABLE_INLINE_AUTOCOMPLETE = "SpannableInlineAutocomplete";
public static final String SPLIT_CACHE_BY_NETWORK_ISOLATION_KEY =
"SplitCacheByNetworkIsolationKey";
public static final String START_SURFACE_ANDROID = "StartSurfaceAndroid"; public static final String START_SURFACE_ANDROID = "StartSurfaceAndroid";
public static final String SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT = public static final String SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT =
"SwapPixelFormatToFixConvertFromTranslucent"; "SwapPixelFormatToFixConvertFromTranslucent";
...@@ -430,21 +438,15 @@ public abstract class ChromeFeatureList { ...@@ -430,21 +438,15 @@ public abstract class ChromeFeatureList {
"TrustedWebActivityQualityEnforcementForced"; "TrustedWebActivityQualityEnforcementForced";
public static final String VIDEO_PERSISTENCE = "VideoPersistence"; public static final String VIDEO_PERSISTENCE = "VideoPersistence";
public static final String VIDEO_TUTORIALS = "VideoTutorials"; public static final String VIDEO_TUTORIALS = "VideoTutorials";
public static final String UPDATE_NOTIFICATION_SCHEDULING_INTEGRATION =
"UpdateNotificationSchedulingIntegration";
public static final String UPDATE_NOTIFICATION_IMMEDIATE_SHOW_OPTION =
"UpdateNotificationScheduleServiceImmediateShowOption";
public static final String USAGE_STATS = "UsageStats"; public static final String USAGE_STATS = "UsageStats";
public static final String VR_BROWSING_FEEDBACK = "VrBrowsingFeedback"; public static final String VR_BROWSING_FEEDBACK = "VrBrowsingFeedback";
public static final String WEBAPK_ADAPTIVE_ICON = "WebApkAdaptiveIcon"; public static final String WEBAPK_ADAPTIVE_ICON = "WebApkAdaptiveIcon";
public static final String WEB_AUTH = "WebAuthentication"; public static final String WEB_AUTH = "WebAuthentication";
public static final String WEB_AUTH_PHONE_SUPPORT = "WebAuthenticationPhoneSupport"; public static final String WEB_AUTH_PHONE_SUPPORT = "WebAuthenticationPhoneSupport";
public static final String SERVICE_MANAGER_FOR_BACKGROUND_PREFETCH =
"ServiceManagerForBackgroundPrefetch";
public static final String SPLIT_CACHE_BY_NETWORK_ISOLATION_KEY =
"SplitCacheByNetworkIsolationKey";
public static final String UPDATE_NOTIFICATION_SCHEDULING_INTEGRATION =
"UpdateNotificationSchedulingIntegration";
public static final String UPDATE_NOTIFICATION_IMMEDIATE_SHOW_OPTION =
"UpdateNotificationScheduleServiceImmediateShowOption";
public static final String PREFETCH_NOTIFICATION_SCHEDULING_INTEGRATION =
"PrefetchNotificationSchedulingIntegration";
@NativeMethods @NativeMethods
interface Natives { interface Natives {
......
...@@ -34,6 +34,14 @@ android_resources("java_resources") { ...@@ -34,6 +34,14 @@ android_resources("java_resources") {
] ]
} }
static_library("feature_flags") {
sources = [
"messages_feature.cc",
"messages_feature.h",
]
deps = [ "//base" ]
}
android_library("javatests") { android_library("javatests") {
testonly = true testonly = true
sources = [ sources = [
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/messages/android/messages_feature.h"
namespace messages {
const base::Feature kMessagesForAndroidInfrastructure{
"MessagesForAndroidInfrastructure", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kMessagesForAndroidPasswords{
"MessagesForAndroidPasswords", base::FEATURE_DISABLED_BY_DEFAULT};
bool IsPasswordMessagesUiEnabled() {
return base::FeatureList::IsEnabled(kMessagesForAndroidInfrastructure) &&
base::FeatureList::IsEnabled(kMessagesForAndroidPasswords);
}
} // namespace messages
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_MESSAGES_ANDROID_MESSAGES_FEATURE_H_
#define COMPONENTS_MESSAGES_ANDROID_MESSAGES_FEATURE_H_
#include "base/feature_list.h"
namespace messages {
// Feature that controls whether Messages for Android infrastucture components
// are initialized. When this feature is disabled all individual message
// implementations also fallback to Infobar implementations.
extern const base::Feature kMessagesForAndroidInfrastructure;
// Feature that controls whether "save password" and "update password" prompts
// use Messages or Infobars infrastructure.
extern const base::Feature kMessagesForAndroidPasswords;
bool IsPasswordMessagesUiEnabled();
} // namespace messages
#endif // COMPONENTS_MESSAGES_ANDROID_MESSAGES_FEATURE_H_
...@@ -40465,6 +40465,7 @@ from previous Chrome versions. ...@@ -40465,6 +40465,7 @@ from previous Chrome versions.
<int value="-2033950090" label="AutofillNoLocalSaveOnUploadSuccess:disabled"/> <int value="-2033950090" label="AutofillNoLocalSaveOnUploadSuccess:disabled"/>
<int value="-2033908928" label="NightLight:enabled"/> <int value="-2033908928" label="NightLight:enabled"/>
<int value="-2033225430" label="NTPMostLikelyFaviconsFromServer:disabled"/> <int value="-2033225430" label="NTPMostLikelyFaviconsFromServer:disabled"/>
<int value="-2033136855" label="MessagesForAndroidPasswords:disabled"/>
<int value="-2030217301" label="password-export:disabled"/> <int value="-2030217301" label="password-export:disabled"/>
<int value="-2029912304" label="StaleWhileRevalidate2:enabled"/> <int value="-2029912304" label="StaleWhileRevalidate2:enabled"/>
<int value="-2028232016" label="spurious-power-button-lid-angle-change"/> <int value="-2028232016" label="spurious-power-button-lid-angle-change"/>
...@@ -42067,6 +42068,7 @@ from previous Chrome versions. ...@@ -42067,6 +42068,7 @@ from previous Chrome versions.
<int value="-419733676" label="IsolatePrerendersMustProbeOrigin:disabled"/> <int value="-419733676" label="IsolatePrerendersMustProbeOrigin:disabled"/>
<int value="-418868128" label="enable-experimental-web-platform-features"/> <int value="-418868128" label="enable-experimental-web-platform-features"/>
<int value="-418676305" label="ScanningUI:enabled"/> <int value="-418676305" label="ScanningUI:enabled"/>
<int value="-417633330" label="MessagesForAndroidInfrastructure:enabled"/>
<int value="-416660617" label="EnforceTLS13Downgrade:disabled"/> <int value="-416660617" label="EnforceTLS13Downgrade:disabled"/>
<int value="-415186532" label="AndroidSiteSettingsUIRefresh:enabled"/> <int value="-415186532" label="AndroidSiteSettingsUIRefresh:enabled"/>
<int value="-412736561" label="EnableZeroStateMixedTypesRanker:enabled"/> <int value="-412736561" label="EnableZeroStateMixedTypesRanker:enabled"/>
...@@ -42844,6 +42846,7 @@ from previous Chrome versions. ...@@ -42844,6 +42846,7 @@ from previous Chrome versions.
<int value="409566604" label="IntentPickerPWAPersistence:enabled"/> <int value="409566604" label="IntentPickerPWAPersistence:enabled"/>
<int value="411250226" label="AutoplayMutedVideos:disabled"/> <int value="411250226" label="AutoplayMutedVideos:disabled"/>
<int value="412957264" label="tab-close-buttons-hidden-with-touch"/> <int value="412957264" label="tab-close-buttons-hidden-with-touch"/>
<int value="413062443" label="MessagesForAndroidInfrastructure:disabled"/>
<int value="413081240" label="enable-new-md-input-view"/> <int value="413081240" label="enable-new-md-input-view"/>
<int value="413695227" label="NTPSuggestionsStandaloneUI:enabled"/> <int value="413695227" label="NTPSuggestionsStandaloneUI:enabled"/>
<int value="414114078" label="LitePageServerPreviews:disabled"/> <int value="414114078" label="LitePageServerPreviews:disabled"/>
...@@ -43278,6 +43281,7 @@ from previous Chrome versions. ...@@ -43278,6 +43281,7 @@ from previous Chrome versions.
<int value="867512869" label="mark-non-secure-as"/> <int value="867512869" label="mark-non-secure-as"/>
<int value="868009556" label="AutofillUpstream:enabled"/> <int value="868009556" label="AutofillUpstream:enabled"/>
<int value="869531646" label="enable-session-crashed-bubble"/> <int value="869531646" label="enable-session-crashed-bubble"/>
<int value="869770301" label="MessagesForAndroidPasswords:enabled"/>
<int value="870568550" label="LimitAltTabToActiveDesk:disabled"/> <int value="870568550" label="LimitAltTabToActiveDesk:disabled"/>
<int value="870664435" label="DownloadProgressInfoBar:disabled"/> <int value="870664435" label="DownloadProgressInfoBar:disabled"/>
<int value="871435095" label="EnableAggregatedMlAppRanking:disabled"/> <int value="871435095" label="EnableAggregatedMlAppRanking:disabled"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment