| 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> |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 std::string group_name = | 165 std::string group_name = |
| 166 base::FieldTrialList::FindFullName("PasswordGeneration"); | 166 base::FieldTrialList::FindFullName("PasswordGeneration"); |
| 167 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 167 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 168 if (command_line->HasSwitch(switches::kEnableIOSPasswordGeneration)) | 168 if (command_line->HasSwitch(switches::kEnableIOSPasswordGeneration)) |
| 169 return true; | 169 return true; |
| 170 if (command_line->HasSwitch(switches::kDisableIOSPasswordGeneration)) | 170 if (command_line->HasSwitch(switches::kDisableIOSPasswordGeneration)) |
| 171 return false; | 171 return false; |
| 172 return group_name != "Disabled"; | 172 return group_name != "Disabled"; |
| 173 } | 173 } |
| 174 | 174 |
| 175 bool IsPaymentRequestEnabled() { | |
| 176 // This call activates the field trial, if needed, so it must come before any | |
| 177 // early returns. | |
| 178 std::string group_name = | |
| 179 base::FieldTrialList::FindFullName("IOSPaymentRequest"); | |
| 180 | |
| 181 // Check if the experimental flag is forced on or off. | |
| 182 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
| 183 if (command_line->HasSwitch(switches::kEnablePaymentRequest)) { | |
| 184 return true; | |
| 185 } else if (command_line->HasSwitch(switches::kDisablePaymentRequest)) { | |
| 186 return false; | |
| 187 } | |
| 188 | |
| 189 // Check if the Finch experiment is turned on. | |
| 190 return base::StartsWith(group_name, "Enabled", | |
| 191 base::CompareCase::INSENSITIVE_ASCII); | |
| 192 } | |
| 193 | |
| 194 bool IsPhysicalWebEnabled() { | 175 bool IsPhysicalWebEnabled() { |
| 195 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 176 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 196 if (command_line->HasSwitch(switches::kEnableIOSPhysicalWeb)) { | 177 if (command_line->HasSwitch(switches::kEnableIOSPhysicalWeb)) { |
| 197 return true; | 178 return true; |
| 198 } else if (command_line->HasSwitch(switches::kDisableIOSPhysicalWeb)) { | 179 } else if (command_line->HasSwitch(switches::kDisableIOSPhysicalWeb)) { |
| 199 return false; | 180 return false; |
| 200 } | 181 } |
| 201 | 182 |
| 202 // Check if the finch experiment is turned on | 183 // Check if the finch experiment is turned on |
| 203 std::string group_name = | 184 std::string group_name = |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } else if (command_line->HasSwitch( | 298 } else if (command_line->HasSwitch( |
| 318 switches::kDisableThirdPartyKeyboardWorkaround)) { | 299 switches::kDisableThirdPartyKeyboardWorkaround)) { |
| 319 return false; | 300 return false; |
| 320 } | 301 } |
| 321 | 302 |
| 322 // Check if the Finch experiment is turned on. | 303 // Check if the Finch experiment is turned on. |
| 323 return base::FeatureList::IsEnabled(kEnableThirdPartyKeyboardWorkaround); | 304 return base::FeatureList::IsEnabled(kEnableThirdPartyKeyboardWorkaround); |
| 324 } | 305 } |
| 325 | 306 |
| 326 } // namespace experimental_flags | 307 } // namespace experimental_flags |
| OLD | NEW |