Chromium Code Reviews| 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..5cbdab6a5339554e86d2af104151cf52484754ec 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,19 @@ 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. This has to be done only if the flag |
|
msarda
2017/03/29 11:41:35
Remove this comment as it is not relevant (it rest
jlebel
2017/03/29 11:47:08
Done.
|
| + // has not been set, so the UI can be tested. |
| + std::string group_name = base::FieldTrialList::FindFullName("IOSSigninPromo"); |
| + return base::StartsWith(group_name, "Enabled", |
| + base::CompareCase::INSENSITIVE_ASCII); |
| +} |
| + |
| } // namespace experimental_flags |