Commit f932e393 authored by shreyasv's avatar shreyasv Committed by Commit bot

Make IsWKWebViewEnabled not query field trial, command line flags.

BUG=579249

Review URL: https://codereview.chromium.org/1625633003

Cr-Commit-Position: refs/heads/master@{#371818}
parent 88f7a362
......@@ -28,8 +28,8 @@ void SetWKWebViewTrialEligibility(bool eligible);
// Whether the lru snapshot cache experiment is enabled.
bool IsLRUSnapshotCacheEnabled();
// Whether the app uses WKWebView instead of UIWebView.
// The returned value will not change within a given session.
// TODO(crbug.com/579697): This always returns true; cleanup codepaths that use
// this.
bool IsWKWebViewEnabled();
// Whether the user would be put into a control group for the WKWebView
......
......@@ -143,27 +143,7 @@ bool CanCheckWKWebViewExperiment() {
}
bool IsWKWebViewEnabled() {
if (!CanCheckWKWebViewExperiment()) {
return false;
}
// Now that it's been established that user is a candidate, set up the trial
// by checking the group.
std::string group_name =
base::FieldTrialList::FindFullName(kWKWebViewTrialName);
// Check if the experimental flag is turned on.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kEnableIOSWKWebView))
return true;
else if (command_line->HasSwitch(switches::kDisableIOSWKWebView))
return false;
// Check if the finch experiment is turned on.
return !base::StartsWith(group_name, "Disabled",
base::CompareCase::INSENSITIVE_ASCII) &&
!base::StartsWith(group_name, "Control",
base::CompareCase::INSENSITIVE_ASCII);
return true;
}
bool IsTargetedToWKWebViewExperimentControlGroup() {
......
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