Commit 40124677 authored by Tommy Martino's avatar Tommy Martino Committed by Commit Bot

[SH iOS] Adding Scroll to Text feature

This feature splits the scroll to text functionality off of the Shared
Highlighting flag. This is needed because:

* The Scroll-to-text portion will be launching first
* The Scroll-to-text portion is being built in //ios/web to enable
  external usage.

Bug: 1099268
Change-Id: I60cbe5d20907d4889aa46a051ec335dfe55b59b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2329947Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Tommy Martino <tmartino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793675}
parent a1962dff
...@@ -3833,6 +3833,11 @@ ...@@ -3833,6 +3833,11 @@
"owners": [ "bingler", "chlily" ], "owners": [ "bingler", "chlily" ],
"expiry_milestone": 90 "expiry_milestone": 90
}, },
{
"name": "scroll-to-text-ios",
"owners": [ "tmartino" ],
"expiry_milestone": 90
},
{ {
"name": "scroll-unification", "name": "scroll-unification",
"owners": [ "bokan@chromium.org", "input-dev@chromium.org" ], "owners": [ "bokan@chromium.org", "input-dev@chromium.org" ],
......
...@@ -680,6 +680,9 @@ const flags_ui::FeatureEntry kFeatureEntries[] = { ...@@ -680,6 +680,9 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
flag_descriptions::kEnableFullPageScreenshotName, flag_descriptions::kEnableFullPageScreenshotName,
flag_descriptions::kEnableFullPageScreenshotDescription, flags_ui::kOsIos, flag_descriptions::kEnableFullPageScreenshotDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kEnableFullPageScreenshot)}, FEATURE_VALUE_TYPE(kEnableFullPageScreenshot)},
{"scroll-to-text-ios", flag_descriptions::kScrollToTextIOSName,
flag_descriptions::kScrollToTextIOSDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(web::features::kScrollToTextIOS)},
}; };
bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) { bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
......
...@@ -421,6 +421,12 @@ const char kSaveCardInfobarMessagesUIName[] = "Save Card Infobar Messages UI"; ...@@ -421,6 +421,12 @@ const char kSaveCardInfobarMessagesUIName[] = "Save Card Infobar Messages UI";
const char kSaveCardInfobarMessagesUIDescription[] = const char kSaveCardInfobarMessagesUIDescription[] =
"When enabled, Save Card Infobar uses the new Messages UI."; "When enabled, Save Card Infobar uses the new Messages UI.";
const char kScrollToTextIOSName[] = "Enable Scroll to Text";
const char kScrollToTextIOSDescription[] =
"When enabled, opening a URL with a text fragment (e.g., "
"example.com/#:~:text=examples) will cause matching text in the page to be "
"highlighted and scrolled into view.";
const char kSendTabToSelfName[] = "Send tab to self"; const char kSendTabToSelfName[] = "Send tab to self";
const char kSendTabToSelfDescription[] = const char kSendTabToSelfDescription[] =
"Allows users to receive tabs that were pushed from another of their " "Allows users to receive tabs that were pushed from another of their "
...@@ -438,9 +444,8 @@ const char kSettingsRefreshDescription[] = ...@@ -438,9 +444,8 @@ const char kSettingsRefreshDescription[] =
const char kSharedHighlightingIOSName[] = "Enable Shared Highlighting features"; const char kSharedHighlightingIOSName[] = "Enable Shared Highlighting features";
const char kSharedHighlightingIOSDescription[] = const char kSharedHighlightingIOSDescription[] =
"Enables support for Text Fragments (scroll-to-text based on URL " "Adds a Link to Text option in the Edit Menu which generates URLs with a "
"directive) and a Link to Text option in the Edit Menu which generates " "text fragment. Works best with the #scroll-to-text-ios flag.";
"these URLs.";
const char kShowAutofillTypePredictionsName[] = "Show Autofill predictions"; const char kShowAutofillTypePredictionsName[] = "Show Autofill predictions";
const char kShowAutofillTypePredictionsDescription[] = const char kShowAutofillTypePredictionsDescription[] =
......
...@@ -366,6 +366,10 @@ extern const char kSafetyCheckIOSDescription[]; ...@@ -366,6 +366,10 @@ extern const char kSafetyCheckIOSDescription[];
extern const char kSaveCardInfobarMessagesUIName[]; extern const char kSaveCardInfobarMessagesUIName[];
extern const char kSaveCardInfobarMessagesUIDescription[]; extern const char kSaveCardInfobarMessagesUIDescription[];
// Title and description for the flag to enable the Scroll to Text feature.
extern const char kScrollToTextIOSName[];
extern const char kScrollToTextIOSDescription[];
// Title and description for the flag to enable the send tab to self receiving // Title and description for the flag to enable the send tab to self receiving
// feature. // feature.
extern const char kSendTabToSelfName[]; extern const char kSendTabToSelfName[];
...@@ -381,7 +385,7 @@ extern const char kSettingsRefreshName[]; ...@@ -381,7 +385,7 @@ extern const char kSettingsRefreshName[];
extern const char kSettingsRefreshDescription[]; extern const char kSettingsRefreshDescription[];
// Title and description for the flag to enable Shared Highlighting (Link to // Title and description for the flag to enable Shared Highlighting (Link to
// Text Edit Menu option and Text Fragments web behavior). // Text Edit Menu option).
extern const char kSharedHighlightingIOSName[]; extern const char kSharedHighlightingIOSName[];
extern const char kSharedHighlightingIOSDescription[]; extern const char kSharedHighlightingIOSDescription[];
......
...@@ -65,8 +65,8 @@ extern const base::Feature kSafetyCheckIOS; ...@@ -65,8 +65,8 @@ extern const base::Feature kSafetyCheckIOS;
// Feature flag to enable new illustrations and UI on empty states. // Feature flag to enable new illustrations and UI on empty states.
extern const base::Feature kIllustratedEmptyStates; extern const base::Feature kIllustratedEmptyStates;
// Feature flag to enable Shared Highlighting (Text Fragments/scroll-to-text // Feature flag to enable Shared Highlighting (Link to Text). Also enable
// and Link to Text features). // kScrollToTextIOS to successfully open these links.
extern const base::Feature kSharedHighlightingIOS; extern const base::Feature kSharedHighlightingIOS;
// Feature flag that enables taking fullpage screenshots of a webpage. // Feature flag that enables taking fullpage screenshots of a webpage.
......
...@@ -57,6 +57,12 @@ extern const base::Feature kIOSLookalikeUrlNavigationSuggestionsUI; ...@@ -57,6 +57,12 @@ extern const base::Feature kIOSLookalikeUrlNavigationSuggestionsUI;
// the URL. // the URL.
extern const base::Feature kAddWebContentDropInteraction; extern const base::Feature kAddWebContentDropInteraction;
// When enabled, opening a URL with a text fragment (e.g.,
// example.com/#:~:text=examples) will cause matching text in the page to be
// highlighted and scrolled into view.
// See also: https://wicg.github.io/scroll-to-text-fragment/
extern const base::Feature kScrollToTextIOS;
// When true, for each navigation, the default user agent is chosen by the // When true, for each navigation, the default user agent is chosen by the
// WebClient GetDefaultUserAgent() method. If it is false, the mobile version // WebClient GetDefaultUserAgent() method. If it is false, the mobile version
// is requested by default. // is requested by default.
......
...@@ -48,6 +48,9 @@ const base::Feature kIOSLookalikeUrlNavigationSuggestionsUI{ ...@@ -48,6 +48,9 @@ const base::Feature kIOSLookalikeUrlNavigationSuggestionsUI{
const base::Feature kAddWebContentDropInteraction{ const base::Feature kAddWebContentDropInteraction{
"AddWebContentDropInteraction", base::FEATURE_DISABLED_BY_DEFAULT}; "AddWebContentDropInteraction", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kScrollToTextIOS{"ScrollToTextIOS",
base::FEATURE_DISABLED_BY_DEFAULT};
bool UseWebClientDefaultUserAgent() { bool UseWebClientDefaultUserAgent() {
if (@available(iOS 13, *)) { if (@available(iOS 13, *)) {
return base::FeatureList::IsEnabled(kUseDefaultUserAgentInWebClient); return base::FeatureList::IsEnabled(kUseDefaultUserAgentInWebClient);
......
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