OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file can be empty. Its purpose is to contain the relatively short lived | 5 // This file can be empty. Its purpose is to contain the relatively short lived |
6 // definitions required for experimental flags. | 6 // definitions required for experimental flags. |
7 | 7 |
8 #include "ios/chrome/browser/experimental_flags.h" | 8 #include "ios/chrome/browser/experimental_flags.h" |
9 | 9 |
10 #include <dispatch/dispatch.h> | 10 #include <dispatch/dispatch.h> |
11 #import <Foundation/Foundation.h> | 11 #import <Foundation/Foundation.h> |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
18 #include "base/strings/sys_string_conversions.h" | 18 #include "base/strings/sys_string_conversions.h" |
19 #include "components/autofill/core/common/autofill_switches.h" | 19 #include "components/autofill/core/common/autofill_switches.h" |
20 #include "components/reading_list/core/reading_list_switches.h" | 20 #include "components/reading_list/core/reading_list_switches.h" |
21 #include "components/signin/core/common/signin_switches.h" | |
21 #include "components/variations/variations_associated_data.h" | 22 #include "components/variations/variations_associated_data.h" |
22 #include "ios/chrome/browser/chrome_switches.h" | 23 #include "ios/chrome/browser/chrome_switches.h" |
23 #include "ios/web/public/web_view_creation_util.h" | 24 #include "ios/web/public/web_view_creation_util.h" |
24 | 25 |
25 #if !defined(__has_feature) || !__has_feature(objc_arc) | 26 #if !defined(__has_feature) || !__has_feature(objc_arc) |
26 #error "This file requires ARC support." | 27 #error "This file requires ARC support." |
27 #endif | 28 #endif |
28 | 29 |
29 namespace { | 30 namespace { |
30 | 31 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 if (command_line->HasSwitch(switches::kEnableSuggestionsUI)) | 269 if (command_line->HasSwitch(switches::kEnableSuggestionsUI)) |
269 return true; | 270 return true; |
270 | 271 |
271 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) | 272 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) |
272 return false; | 273 return false; |
273 | 274 |
274 // By default, disable it. | 275 // By default, disable it. |
275 return false; | 276 return false; |
276 } | 277 } |
277 | 278 |
279 bool IsSigninPromoEnabled() { | |
280 // Check if the experimental flag is forced on or off. | |
281 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
282 if (command_line->HasSwitch(switches::kEnableSigninPromo)) | |
283 return true; | |
284 if (command_line->HasSwitch(switches::kDisableSigninPromo)) | |
285 return false; | |
286 | |
287 // 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.
| |
288 // has not been set, so the UI can be tested. | |
289 std::string group_name = base::FieldTrialList::FindFullName("IOSSigninPromo"); | |
290 return base::StartsWith(group_name, "Enabled", | |
291 base::CompareCase::INSENSITIVE_ASCII); | |
292 } | |
293 | |
278 } // namespace experimental_flags | 294 } // namespace experimental_flags |
OLD | NEW |