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

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

Issue 2779693003: Adding Finch and flag for Sign-in promo (Closed)
Patch Set: . Created 3 years, 9 months 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
Index: ios/chrome/browser/experimental_flags.mm
diff --git a/ios/chrome/browser/experimental_flags.mm b/ios/chrome/browser/experimental_flags.mm
index 83cd53180ee5d9b6540beb9046ce15b558451af0..f4bb55220346c916505a1663b6096c82614ec77a 100644
--- a/ios/chrome/browser/experimental_flags.mm
+++ b/ios/chrome/browser/experimental_flags.mm
@@ -18,6 +18,7 @@
#include "base/strings/sys_string_conversions.h"
#include "components/autofill/core/common/autofill_switches.h"
#include "components/reading_list/core/reading_list_switches.h"
+#include "components/signin/core/common/signin_switches.h"
#include "components/variations/variations_associated_data.h"
#include "ios/chrome/browser/chrome_switches.h"
#include "ios/web/public/web_view_creation_util.h"
@@ -275,4 +276,20 @@ bool IsSuggestionsUIEnabled() {
return false;
}
+bool IsSigninPromoEnabled() {
+ // Check if the experimental flag is forced on or off.
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kEnableSigninPromo))
+ return true;
+
+ if (command_line->HasSwitch(switches::kDisableSigninPromo))
+ return false;
+
+ // This call activates the field trial, if needed, so it must come before any
sdefresne 2017/03/29 10:37:07 This comment contradict the code. Code should eith
jlebel 2017/03/29 10:58:35 Done.
+ // early returns.
+ std::string group_name = base::FieldTrialList::FindFullName("IOSSigninPromo");
+ return base::StartsWith(group_name, "Enabled",
+ base::CompareCase::INSENSITIVE_ASCII);
+}
+
} // namespace experimental_flags

Powered by Google App Engine
This is Rietveld 408576698