Commit 8fa18d98 authored by Robbie Gibson's avatar Robbie Gibson Committed by Commit Bot

Revert "[iOS] Decouple Text Zoom flag from Dynamic Text size as default zoom"

This reverts commit 6e145aaa.

Reason for revert: Incorrect behavior when flag is enabled.

Original change's description:
> [iOS] Decouple Text Zoom flag from Dynamic Text size as default zoom
> 
> Before, this happened by default. However, this was confusing, so now
> there are two separate flags, so zoom can be enabled without changing
> the default zoom level.
> 
> Bug: 1113270
> Change-Id: I34e340c585c5ccccdfd278d96c21a53510b6a234
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339482
> Commit-Queue: Robbie Gibson <rkgibson@google.com>
> Reviewed-by: Rohit Rao <rohitrao@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#795408}

TBR=rohitrao@chromium.org,rkgibson@google.com

Change-Id: I557c9410d721b27472bdb200f58462fa428fd8d4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1113270
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339987Reviewed-by: default avatarRobbie Gibson <rkgibson@google.com>
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Cr-Commit-Position: refs/heads/master@{#795456}
parent 64163830
...@@ -4441,14 +4441,9 @@ ...@@ -4441,14 +4441,9 @@
"owners": [ "ayui", "goto" ], "owners": [ "ayui", "goto" ],
"expiry_milestone": 86 "expiry_milestone": 86
}, },
{
"name": "webpage-default-zoom-from-dynamic-type",
"owners": [ "rkgibson", "bling-flags" ],
"expiry_milestone": 87
},
{ {
"name": "webpage-text-accessibility", "name": "webpage-text-accessibility",
"owners": [ "rkgibson", "bling-flags" ], "owners": [ "rkgibson" ],
"expiry_milestone": 86 "expiry_milestone": 86
}, },
{ {
......
...@@ -380,11 +380,6 @@ const flags_ui::FeatureEntry kFeatureEntries[] = { ...@@ -380,11 +380,6 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAutofillEnableCompanyNameName, flag_descriptions::kAutofillEnableCompanyNameName,
flag_descriptions::kAutofillEnableCompanyNameDescription, flags_ui::kOsIos, flag_descriptions::kAutofillEnableCompanyNameDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCompanyName)}, FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCompanyName)},
{"webpage-default-zoom-from-dynamic-type",
flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
flags_ui::kOsIos,
FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
{"webpage-text-accessibility", {"webpage-text-accessibility",
flag_descriptions::kWebPageTextAccessibilityName, flag_descriptions::kWebPageTextAccessibilityName,
flag_descriptions::kWebPageTextAccessibilityDescription, flags_ui::kOsIos, flag_descriptions::kWebPageTextAccessibilityDescription, flags_ui::kOsIos,
......
...@@ -503,17 +503,12 @@ const char kWalletServiceUseSandboxName[] = "Use Google Payments sandbox"; ...@@ -503,17 +503,12 @@ const char kWalletServiceUseSandboxName[] = "Use Google Payments sandbox";
const char kWalletServiceUseSandboxDescription[] = const char kWalletServiceUseSandboxDescription[] =
"Uses the sandbox service for Google Payments API calls."; "Uses the sandbox service for Google Payments API calls.";
const char kWebPageDefaultZoomFromDynamicTypeName[] =
"Use dynamic type size for default text zoom level";
const char kWebPageDefaultZoomFromDynamicTypeDescription[] =
"When enabled, the default text zoom level for a website comes from the "
"current dynamic type setting.";
const char kWebPageTextAccessibilityName[] = const char kWebPageTextAccessibilityName[] =
"Enable text accessibility in web pages"; "Enable text accessibility in web pages";
const char kWebPageTextAccessibilityDescription[] = const char kWebPageTextAccessibilityDescription[] =
"When enabled, text in web pages will respect the user's Dynamic Type " "When enabled, text in web pages will respect the user's Dynamic Type "
"setting."; "setting.";
// Please insert your name/description above in alphabetical order. // Please insert your name/description above in alphabetical order.
} // namespace flag_descriptions } // namespace flag_descriptions
...@@ -442,11 +442,6 @@ extern const char kUseJSForErrorPageDescription[]; ...@@ -442,11 +442,6 @@ extern const char kUseJSForErrorPageDescription[];
extern const char kWalletServiceUseSandboxName[]; extern const char kWalletServiceUseSandboxName[];
extern const char kWalletServiceUseSandboxDescription[]; extern const char kWalletServiceUseSandboxDescription[];
// Title and description for the flag to tie the default text zoom level to
// the dynamic type setting.
extern const char kWebPageDefaultZoomFromDynamicTypeName[];
extern const char kWebPageDefaultZoomFromDynamicTypeDescription[];
// Title and description for the flag to enable text accessibility in webpages. // Title and description for the flag to enable text accessibility in webpages.
extern const char kWebPageTextAccessibilityName[]; extern const char kWebPageTextAccessibilityName[];
extern const char kWebPageTextAccessibilityDescription[]; extern const char kWebPageTextAccessibilityDescription[];
......
...@@ -9,9 +9,6 @@ namespace web { ...@@ -9,9 +9,6 @@ namespace web {
const base::Feature kWebPageTextAccessibility{"WebPageTextAccessibility", const base::Feature kWebPageTextAccessibility{"WebPageTextAccessibility",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kWebPageDefaultZoomFromDynamicType{
"WebPageDefaultZoomFromDynamicType", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kMobileGoogleSRP{"MobileGoogleSRP", const base::Feature kMobileGoogleSRP{"MobileGoogleSRP",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
......
...@@ -13,10 +13,6 @@ namespace web { ...@@ -13,10 +13,6 @@ namespace web {
// Used to control the state of the WebPageTextAccessibility feature. // Used to control the state of the WebPageTextAccessibility feature.
extern const base::Feature kWebPageTextAccessibility; extern const base::Feature kWebPageTextAccessibility;
// Feature flag to tie the default zoom level for webpages to the current
// dynamic type setting.
extern const base::Feature kWebPageDefaultZoomFromDynamicType;
// Feature flag to keep the mobile version for Google SRP. Should be used when // Feature flag to keep the mobile version for Google SRP. Should be used when
// the desktop version is requested by default. // the desktop version is requested by default.
extern const base::Feature kMobileGoogleSRP; extern const base::Feature kMobileGoogleSRP;
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/pref_names.h" #include "ios/chrome/browser/pref_names.h"
#include "ios/chrome/browser/web/features.h"
#include "ios/components/ui_util/dynamic_type_util.h" #include "ios/components/ui_util/dynamic_type_util.h"
#include "ios/web/public/js_messaging/web_frame.h" #include "ios/web/public/js_messaging/web_frame.h"
#include "ios/web/public/js_messaging/web_frame_util.h" #include "ios/web/public/js_messaging/web_frame_util.h"
...@@ -241,13 +240,9 @@ bool FontSizeTabHelper::CurrentPageSupportsTextZoom() const { ...@@ -241,13 +240,9 @@ bool FontSizeTabHelper::CurrentPageSupportsTextZoom() const {
} }
int FontSizeTabHelper::GetFontSize() const { int FontSizeTabHelper::GetFontSize() const {
// Only add in the dynamic type multiplier if the flag is enabled.
double dynamic_type_multiplier =
base::FeatureList::IsEnabled(web::kWebPageDefaultZoomFromDynamicType)
? ui_util::SystemSuggestedFontSizeMultiplier()
: 1;
// Multiply by 100 as the web property needs a percentage. // Multiply by 100 as the web property needs a percentage.
return dynamic_type_multiplier * GetCurrentUserZoomMultiplier() * 100; return ui_util::SystemSuggestedFontSizeMultiplier() *
GetCurrentUserZoomMultiplier() * 100;
} }
void FontSizeTabHelper::WebStateDestroyed(web::WebState* web_state) { void FontSizeTabHelper::WebStateDestroyed(web::WebState* web_state) {
......
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