Skip to content

Commit

Permalink
FontAccess: Feature flag for chooser API
Browse files Browse the repository at this point in the history
Adds a feature flag to gate a chooser API.
This API's purpose is to enable developers to request access to fonts
installed on users' local machines. The request will be satisfied with
users selecting fonts from a "chooser"-style interface.

Bug: 1138621
Change-Id: I3574fe95517c3167316f4540d113e3dfff9059cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2472462
Commit-Queue: Olivier Yiptong <oyiptong@chromium.org>
Auto-Submit: Olivier Yiptong <oyiptong@chromium.org>
Reviewed-by: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817687}
  • Loading branch information
oyiptong authored and Commit Bot committed Oct 15, 2020
1 parent 015f38f commit dcf600b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5595,6 +5595,10 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kFontAccessAPIDescription, kOsAll,
FEATURE_VALUE_TYPE(blink::features::kFontAccess)},

{"font-access-chooser", flag_descriptions::kFontAccessChooserAPIName,
flag_descriptions::kFontAccessChooserAPIDescription, kOsAll,
FEATURE_VALUE_TYPE(blink::features::kFontAccessChooser)},

{"mouse-subframe-no-implicit-capture",
flag_descriptions::kMouseSubframeNoImplicitCaptureName,
flag_descriptions::kMouseSubframeNoImplicitCaptureDescription, kOsAll,
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/flag-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2585,6 +2585,11 @@
"owners": [ "cmp", "oyiptong" ],
"expiry_milestone": 90
},
{
"name": "font-access-chooser",
"owners": [ "oyiptong" ],
"expiry_milestone": 92
},
{
"name": "force-color-profile",
"owners": [ "ccameron" ],
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ const char kFontAccessAPIDescription[] =
"Enables the experimental Font Access APIs, giving websites access "
"to enumerate local fonts and access their table data.";

const char kFontAccessChooserAPIName[] = "Font Access Chooser API";
const char kFontAccessChooserAPIDescription[] =
"Enables the experimental Font Access Chooser API, giving websites access "
"to local font data using a picker.";

const char kForceColorProfileSRGB[] = "sRGB";
const char kForceColorProfileP3[] = "Display P3 D65";
const char kForceColorProfileColorSpin[] = "Color spin with gamma 2.4";
Expand Down
3 changes: 3 additions & 0 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ extern const char
extern const char kFontAccessAPIName[];
extern const char kFontAccessAPIDescription[];

extern const char kFontAccessChooserAPIName[];
extern const char kFontAccessChooserAPIDescription[];

extern const char kForceColorProfileSRGB[];
extern const char kForceColorProfileP3[];
extern const char kForceColorProfileColorSpin[];
Expand Down
4 changes: 4 additions & 0 deletions third_party/blink/common/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ const base::Feature kAllowSyncXHRInPageDismissal{
const base::Feature kFontAccess{"FontAccess",
base::FEATURE_DISABLED_BY_DEFAULT};

// Font access using a chooser interface. https://crbug.com/1138621
const base::Feature kFontAccessChooser{"FontAccessChooser",
base::FEATURE_DISABLED_BY_DEFAULT};

// Allows Web Components v0 to be re-enabled.
const base::Feature kWebComponentsV0{"WebComponentsV0",
base::FEATURE_DISABLED_BY_DEFAULT};
Expand Down
1 change: 1 addition & 0 deletions third_party/blink/public/common/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ BLINK_COMMON_EXPORT extern const base::Feature kStopNonTimersInBackground;
BLINK_COMMON_EXPORT extern const base::Feature kStorageAccessAPI;
BLINK_COMMON_EXPORT extern const base::Feature kTextFragmentAnchor;
BLINK_COMMON_EXPORT extern const base::Feature kFontAccess;
BLINK_COMMON_EXPORT extern const base::Feature kFontAccessChooser;
BLINK_COMMON_EXPORT extern const base::Feature kFileHandlingAPI;
BLINK_COMMON_EXPORT extern const base::Feature kAllowSyncXHRInPageDismissal;
BLINK_COMMON_EXPORT extern const base::Feature kPrefetchPrivacyChanges;
Expand Down
2 changes: 2 additions & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43467,6 +43467,7 @@ from previous Chrome versions.
<int value="-152677714" label="AsmJsToWebAssembly:enabled"/>
<int value="-152632720" label="RuntimeHostPermissions:enabled"/>
<int value="-152439608" label="download-later-debug-on-wifi"/>
<int value="-150077791" label="FontAccessChooser:disabled"/>
<int value="-147283486" label="enable-network-portal-notification"/>
<int value="-146552997" label="enable-affiliation-based-matching"/>
<int value="-146315671" label="PrivacyAdvisor:enabled"/>
Expand Down Expand Up @@ -43712,6 +43713,7 @@ from previous Chrome versions.
<int value="84911198" label="ScanCardsInWebPayments:disabled"/>
<int value="87886288" label="DiagnosticsApp:enabled"/>
<int value="88437020" label="FeaturePolicy:enabled"/>
<int value="89758831" label="FontAccessChooser:enabled"/>
<int value="89785725"
label="DataReductionProxyEnabledWithNetworkService:disabled"/>
<int value="90551098" label="UseWallpaperStagingUrl:enabled"/>
Expand Down

0 comments on commit dcf600b

Please sign in to comment.