Commit 468b6d5f authored by Eugene But's avatar Eugene But Committed by Commit Bot

Add IgnoresViewportScaleLimits feature behind the flag.

When enabled the page can always be scaled, regardless of author intent.

Bug: 719573
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I01051016300e816daf0335c8394ad607cdb5d9b8
Reviewed-on: https://chromium-review.googlesource.com/c/1289440Reviewed-by: default avatarAli Juma <ajuma@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600912}
parent 222d3f43
...@@ -186,6 +186,11 @@ const flags_ui::FeatureEntry kFeatureEntries[] = { ...@@ -186,6 +186,11 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
{"external-search", flag_descriptions::kExternalSearchName, {"external-search", flag_descriptions::kExternalSearchName,
flag_descriptions::kExternalSearchDescription, flags_ui::kOsIos, flag_descriptions::kExternalSearchDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kExternalSearch)}, FEATURE_VALUE_TYPE(kExternalSearch)},
{"ignores-viewport-scale-limits",
flag_descriptions::kIgnoresViewportScaleLimitsName,
flag_descriptions::kIgnoresViewportScaleLimitsDescription,
flags_ui::kOsIos,
FEATURE_VALUE_TYPE(web::features::kIgnoresViewportScaleLimits)},
{"slim-navigation-manager", flag_descriptions::kSlimNavigationManagerName, {"slim-navigation-manager", flag_descriptions::kSlimNavigationManagerName,
flag_descriptions::kSlimNavigationManagerDescription, flags_ui::kOsIos, flag_descriptions::kSlimNavigationManagerDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(web::features::kSlimNavigationManager)}, FEATURE_VALUE_TYPE(web::features::kSlimNavigationManager)},
......
...@@ -246,6 +246,10 @@ const char kPhysicalWebDescription[] = ...@@ -246,6 +246,10 @@ const char kPhysicalWebDescription[] =
"When enabled, the omnibox will include suggestions for web pages " "When enabled, the omnibox will include suggestions for web pages "
"broadcast by devices near you."; "broadcast by devices near you.";
const char kIgnoresViewportScaleLimitsName[] = "Ignore Viewport Scale Limits";
const char kIgnoresViewportScaleLimitsDescription[] =
"When enabled the page can always be scaled, regardless of author intent.";
const char kSlimNavigationManagerName[] = "Use Slim Navigation Manager"; const char kSlimNavigationManagerName[] = "Use Slim Navigation Manager";
const char kSlimNavigationManagerDescription[] = const char kSlimNavigationManagerDescription[] =
"When enabled, uses the experimental slim navigation manager that provides " "When enabled, uses the experimental slim navigation manager that provides "
......
...@@ -203,6 +203,10 @@ extern const char kOutOfWebFullscreenDescription[]; ...@@ -203,6 +203,10 @@ extern const char kOutOfWebFullscreenDescription[];
extern const char kPhysicalWeb[]; extern const char kPhysicalWeb[];
extern const char kPhysicalWebDescription[]; extern const char kPhysicalWebDescription[];
// Title and description for the flag to ignore viewport scale limits.
extern const char kIgnoresViewportScaleLimitsName[];
extern const char kIgnoresViewportScaleLimitsDescription[];
// Title and description for the flag to enable WKBackForwardList based // Title and description for the flag to enable WKBackForwardList based
// navigation manager. // navigation manager.
extern const char kSlimNavigationManagerName[]; extern const char kSlimNavigationManagerName[];
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
namespace web { namespace web {
namespace features { namespace features {
const base::Feature kIgnoresViewportScaleLimits{
"IgnoresViewportScaleLimits", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kWebFrameMessaging{"WebFrameMessaging", const base::Feature kWebFrameMessaging{"WebFrameMessaging",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
namespace web { namespace web {
namespace features { namespace features {
// Used to always allow scaling of the web page, regardless of author intent.
extern const base::Feature kIgnoresViewportScaleLimits;
// Used to enable API to send messages directly to frames of a webpage. // Used to enable API to send messages directly to frames of a webpage.
extern const base::Feature kWebFrameMessaging; extern const base::Feature kWebFrameMessaging;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "ios/web/public/browser_state.h" #include "ios/web/public/browser_state.h"
#include "ios/web/public/features.h"
#import "ios/web/web_state/js/page_script_util.h" #import "ios/web/web_state/js/page_script_util.h"
#import "ios/web/web_state/ui/crw_wk_script_message_router.h" #import "ios/web/web_state/ui/crw_wk_script_message_router.h"
...@@ -85,8 +86,12 @@ WKWebViewConfigurationProvider::GetWebViewConfiguration() { ...@@ -85,8 +86,12 @@ WKWebViewConfigurationProvider::GetWebViewConfiguration() {
[configuration_ [configuration_
setWebsiteDataStore:[WKWebsiteDataStore nonPersistentDataStore]]; setWebsiteDataStore:[WKWebsiteDataStore nonPersistentDataStore]];
} }
// API available on iOS 9, although doesn't appear to enable inline playback
// Works as intended on iOS 10+ if (base::FeatureList::IsEnabled(
web::features::kIgnoresViewportScaleLimits)) {
[configuration_ setIgnoresViewportScaleLimits:YES];
}
[configuration_ setAllowsInlineMediaPlayback:YES]; [configuration_ setAllowsInlineMediaPlayback:YES];
// setJavaScriptCanOpenWindowsAutomatically is required to support popups. // setJavaScriptCanOpenWindowsAutomatically is required to support popups.
[[configuration_ preferences] setJavaScriptCanOpenWindowsAutomatically:YES]; [[configuration_ preferences] setJavaScriptCanOpenWindowsAutomatically:YES];
......
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