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 |