Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Unified Diff: ios/chrome/browser/experimental_flags.mm

Issue 1495443006: Keep WKWebView control group users in the control group (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/experimental_flags.h ('k') | ios/chrome/browser/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/experimental_flags.mm
diff --git a/ios/chrome/browser/experimental_flags.mm b/ios/chrome/browser/experimental_flags.mm
index 3b31adf9af4718ed6364534d3ef4bec277adba56..0fd40ed803867388f34d6f5355e256aa9ad2ba70 100644
--- a/ios/chrome/browser/experimental_flags.mm
+++ b/ios/chrome/browser/experimental_flags.mm
@@ -27,6 +27,7 @@ NSString* const kEnableAlertOnBackgroundUpload =
NSString* const kEnableViewCopyPasswords = @"EnableViewCopyPasswords";
NSString* const kHeuristicsForPasswordGeneration =
@"HeuristicsForPasswordGeneration";
+const char* const kWKWebViewTrialName = "IOSUseWKWebView";
enum class WKWebViewEligibility {
// UNSET indicates that no explicit call to set eligibility has been made,
@@ -128,6 +129,11 @@ bool IsWKWebViewEnabled() {
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))
@@ -135,22 +141,36 @@ bool IsWKWebViewEnabled() {
else if (command_line->HasSwitch(switches::kDisableIOSWKWebView))
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("IOSUseWKWebView");
-
// Check if the finch experiment is turned on.
return base::StartsWith(group_name, "Enabled",
base::CompareCase::INSENSITIVE_ASCII);
}
+bool IsTargetedToWKWebViewExperimentControlGroup() {
+ base::FieldTrial* trial = base::FieldTrialList::Find(kWKWebViewTrialName);
+ if (!trial)
+ return false;
+ std::string group_name = trial->GetGroupNameWithoutActivation();
+ return base::StartsWith(group_name, "Control",
+ base::CompareCase::INSENSITIVE_ASCII);
+}
+
+bool IsInWKWebViewExperimentControlGroup() {
+ if (!CanCheckWKWebViewExperiment()) {
+ return false;
+ }
+ std::string group_name =
+ base::FieldTrialList::FindFullName(kWKWebViewTrialName);
+ return base::StartsWith(group_name, "Control",
+ base::CompareCase::INSENSITIVE_ASCII);
+}
+
std::string GetWKWebViewSearchParams() {
if (!CanCheckWKWebViewExperiment()) {
return std::string();
}
- return variations::GetVariationParamValue("IOSUseWKWebView", "esrch");
+ return variations::GetVariationParamValue(kWKWebViewTrialName, "esrch");
}
bool AreKeyboardCommandsEnabled() {
« no previous file with comments | « ios/chrome/browser/experimental_flags.h ('k') | ios/chrome/browser/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698