Commit 3804fbc2 authored by Gang Wu's avatar Gang Wu Committed by Commit Bot

[Omnibox] Remove the Omnibox text suggestion flag

Bug: 977402

Change-Id: Ic77cd4b54b5ee5d46ebcd1a7c55313cdccabc199
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090293Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Gang Wu <gangwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752671}
parent 364d528b
......@@ -21,6 +21,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/task_traits.h"
#include "build/build_config.h"
#include "components/omnibox/browser/autocomplete_input.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_provider_client.h"
......@@ -279,12 +280,6 @@ base::Optional<AutocompleteMatch> ClipboardProvider::CreateURLMatch(
base::Optional<AutocompleteMatch> ClipboardProvider::CreateTextMatch(
const AutocompleteInput& input) {
// Only try text match if feature is enabled
if (!base::FeatureList::IsEnabled(
omnibox::kEnableClipboardProviderTextSuggestions)) {
return base::nullopt;
}
base::Optional<base::string16> optional_text =
clipboard_content_->GetRecentTextFromClipboard();
if (!optional_text)
......@@ -330,16 +325,6 @@ base::Optional<AutocompleteMatch> ClipboardProvider::CreateTextMatch(
match.keyword = default_url->keyword();
match.transition = ui::PAGE_TRANSITION_GENERATED;
// Some users may be in a counterfactual study arm in which we perform all
// necessary work but do not forward the autocomplete matches.
bool in_counterfactual_group = base::GetFieldTrialParamByFeatureAsBool(
omnibox::kEnableClipboardProviderTextSuggestions,
"ClipboardProviderTextSuggestionsCounterfactualArm", false);
field_trial_triggered_ = true;
field_trial_triggered_in_session_ = true;
if (in_counterfactual_group)
return base::nullopt;
return match;
}
......
......@@ -13,6 +13,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "components/omnibox/browser/autocomplete_input.h"
#include "components/omnibox/browser/autocomplete_provider_listener.h"
#include "components/omnibox/browser/mock_autocomplete_provider_client.h"
......@@ -119,9 +120,6 @@ TEST_F(ClipboardProviderTest, HasMultipleMatches) {
}
TEST_F(ClipboardProviderTest, MatchesText) {
base::test::ScopedFeatureList feature_list;
base::Feature textFeature = omnibox::kEnableClipboardProviderTextSuggestions;
feature_list.InitAndEnableFeature(textFeature);
auto template_url_service = std::make_unique<TemplateURLService>(
/*initializers=*/nullptr, /*count=*/0);
client_->set_template_url_service(std::move(template_url_service));
......@@ -154,9 +152,6 @@ TEST_F(ClipboardProviderTest, MatchesImage) {
}
TEST_F(ClipboardProviderTest, DeleteMatch) {
base::test::ScopedFeatureList feature_list;
base::Feature textFeature = omnibox::kEnableClipboardProviderTextSuggestions;
feature_list.InitAndEnableFeature(textFeature);
auto template_url_service = std::make_unique<TemplateURLService>(
/*initializers=*/nullptr, /*count=*/0);
client_->set_template_url_service(std::move(template_url_service));
......
......@@ -130,17 +130,6 @@ const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
const base::Feature kOmniboxSuggestionTransparencyOptions{
"OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
// Feature to enable clipboard provider to suggest copied text.
// TODO(gangwu): Remove this feature flag after full launched in Android.
const base::Feature kEnableClipboardProviderTextSuggestions{
"OmniboxEnableClipboardProviderTextSuggestions",
#if defined(OS_IOS) || defined(OS_ANDROID)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
// Feature to enable clipboard provider to suggest searching for copied images.
const base::Feature kEnableClipboardProviderImageSuggestions{
"OmniboxEnableClipboardProviderImageSuggestions",
......
......@@ -28,7 +28,6 @@ extern const base::Feature kOmniboxTabSwitchSuggestionsDedicatedRow;
extern const base::Feature kExperimentalKeywordMode;
extern const base::Feature kOmniboxPedalSuggestions;
extern const base::Feature kOmniboxSuggestionTransparencyOptions;
extern const base::Feature kEnableClipboardProviderTextSuggestions;
extern const base::Feature kEnableClipboardProviderImageSuggestions;
extern const base::Feature kSearchProviderWarmUpOnFocus;
extern const base::Feature kDisplayTitleForCurrentUrl;
......
......@@ -399,11 +399,6 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
{"find-in-page-iframe", flag_descriptions::kFindInPageiFrameName,
flag_descriptions::kFindInPageiFrameDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kFindInPageiFrame)},
{"enable-clipboard-provider-text-suggestions",
flag_descriptions::kEnableClipboardProviderTextSuggestionsName,
flag_descriptions::kEnableClipboardProviderTextSuggestionsDescription,
flags_ui::kOsIos,
FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProviderTextSuggestions)},
{"enable-clipboard-provider-image-suggestions",
flag_descriptions::kEnableClipboardProviderImageSuggestionsName,
flag_descriptions::kEnableClipboardProviderImageSuggestionsDescription,
......
......@@ -205,11 +205,6 @@ const char kEnableClipboardProviderImageSuggestionsName[] =
const char kEnableClipboardProviderImageSuggestionsDescription[] =
"Enable suggesting a search for the image copied to the clipboard";
const char kEnableClipboardProviderTextSuggestionsName[] =
"Enable copied text provider";
const char kEnableClipboardProviderTextSuggestionsDescription[] =
"Enable suggesting a search for text copied to the clipboard";
const char kUseJSForErrorPageName[] = "Enable new error page workflow";
const char kUseJSForErrorPageDescription[] =
"Use JavaScript for the error pages";
......
......@@ -172,11 +172,6 @@ extern const char
extern const char kEnableClipboardProviderImageSuggestionsName[];
extern const char kEnableClipboardProviderImageSuggestionsDescription[];
// Title and description for the flag to enable the clipboard provider to
// suggest copied text
extern const char kEnableClipboardProviderTextSuggestionsName[];
extern const char kEnableClipboardProviderTextSuggestionsDescription[];
// Title and description for the flag to enable the new error page workflow.
extern const char kUseJSForErrorPageName[];
extern const char kUseJSForErrorPageDescription[];
......
......@@ -3557,7 +3557,6 @@
"NtpRealboxMatchOmniboxTheme",
"OmniboxDisplayTitleForCurrentUrl",
"OmniboxDocumentProvider",
"OmniboxEnableClipboardProviderTextSuggestions",
"OmniboxLocalEntitySuggestions",
"OmniboxMaxURLMatches",
"OmniboxOnFocusSuggestions",
......
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