Commit 6d9fec40 authored by Tommy Martino's avatar Tommy Martino Committed by Commit Bot

[Autofill Views] Adding upcoming-ui-features flag

This new flag is meant to enable all upcoming ui features, so it should
force the new dropdown on even if the dropdown-specific flag is off.

Change-Id: Ia3aa38285bf4a60fa72250ac35d8cc9e20ae98a7
Reviewed-on: https://chromium-review.googlesource.com/1089791
Commit-Queue: Tommy Martino <tmartino@chromium.org>
Reviewed-by: default avatarFabio Tirelo <ftirelo@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565074}
parent 46153b54
...@@ -311,7 +311,7 @@ AutofillPopupView* AutofillPopupView::Create( ...@@ -311,7 +311,7 @@ AutofillPopupView* AutofillPopupView::Create(
return nullptr; return nullptr;
#endif #endif
if (base::FeatureList::IsEnabled(autofill::kAutofillExpandedPopupViews)) if (autofill::ShouldUseNativeViews())
return new AutofillPopupViewNativeViews(controller, observing_widget); return new AutofillPopupViewNativeViews(controller, observing_widget);
return new AutofillPopupViewViews(controller, observing_widget); return new AutofillPopupViewViews(controller, observing_widget);
......
...@@ -200,4 +200,13 @@ bool IsMacViewsAutofillPopupExperimentEnabled() { ...@@ -200,4 +200,13 @@ bool IsMacViewsAutofillPopupExperimentEnabled() {
} }
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
bool ShouldUseNativeViews() {
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
return base::FeatureList::IsEnabled(kAutofillExpandedPopupViews) ||
base::FeatureList::IsEnabled(features::kExperimentalUi);
#else
return false;
#endif
}
} // namespace autofill } // namespace autofill
...@@ -108,6 +108,11 @@ bool IsAutofillUpstreamUpdatePromptExplanationExperimentEnabled(); ...@@ -108,6 +108,11 @@ bool IsAutofillUpstreamUpdatePromptExplanationExperimentEnabled();
bool IsMacViewsAutofillPopupExperimentEnabled(); bool IsMacViewsAutofillPopupExperimentEnabled();
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
// Returns true if the native Views implementation of the Desktop dropdown
// should be used. This will also be true if the kExperimentalUi flag is true,
// which forces a bunch of forthcoming UI changes on.
bool ShouldUseNativeViews();
} // namespace autofill } // namespace autofill
#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_
...@@ -90,8 +90,7 @@ void AutofillExternalDelegate::OnSuggestionsReturned( ...@@ -90,8 +90,7 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
// go between the values and menu items. Skip this when using the Native Views // go between the values and menu items. Skip this when using the Native Views
// implementation, which has its own logic for distinguishing footer rows. // implementation, which has its own logic for distinguishing footer rows.
// TODO(crbug.com/831603): Remove this when the relevant feature is on 100%. // TODO(crbug.com/831603): Remove this when the relevant feature is on 100%.
if (!suggestions.empty() && if (!suggestions.empty() && !autofill::ShouldUseNativeViews()) {
!base::FeatureList::IsEnabled(autofill::kAutofillExpandedPopupViews)) {
suggestions.push_back(Suggestion()); suggestions.push_back(Suggestion());
suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR; suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR;
} }
......
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