| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 bool IsStartupCrashEnabled() { | 243 bool IsStartupCrashEnabled() { |
| 244 return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableStartupCrash]; | 244 return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableStartupCrash]; |
| 245 } | 245 } |
| 246 | 246 |
| 247 bool IsTabStripAutoScrollNewTabsEnabled() { | 247 bool IsTabStripAutoScrollNewTabsEnabled() { |
| 248 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 248 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 249 return !command_line->HasSwitch(switches::kDisableTabStripAutoScrollNewTabs); | 249 return !command_line->HasSwitch(switches::kDisableTabStripAutoScrollNewTabs); |
| 250 } | 250 } |
| 251 | 251 |
| 252 bool IsTabSwitcherEnabled() { | |
| 253 // Check if the experimental flag is forced off. | |
| 254 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
| 255 if (command_line->HasSwitch(switches::kDisableTabSwitcher)) { | |
| 256 return false; | |
| 257 } | |
| 258 | |
| 259 // Check if the finch experiment is turned off. | |
| 260 std::string group_name = base::FieldTrialList::FindFullName("IOSTabSwitcher"); | |
| 261 return !base::StartsWith(group_name, "Disabled", | |
| 262 base::CompareCase::INSENSITIVE_ASCII); | |
| 263 } | |
| 264 | |
| 265 bool IsViewCopyPasswordsEnabled() { | 252 bool IsViewCopyPasswordsEnabled() { |
| 266 NSString* viewCopyPasswordFlag = [[NSUserDefaults standardUserDefaults] | 253 NSString* viewCopyPasswordFlag = [[NSUserDefaults standardUserDefaults] |
| 267 objectForKey:kEnableViewCopyPasswords]; | 254 objectForKey:kEnableViewCopyPasswords]; |
| 268 if ([viewCopyPasswordFlag isEqualToString:@"Enabled"]) | 255 if ([viewCopyPasswordFlag isEqualToString:@"Enabled"]) |
| 269 return true; | 256 return true; |
| 270 return false; | 257 return false; |
| 271 } | 258 } |
| 272 | 259 |
| 273 bool UseOnlyLocalHeuristicsForPasswordGeneration() { | 260 bool UseOnlyLocalHeuristicsForPasswordGeneration() { |
| 274 if ([[NSUserDefaults standardUserDefaults] | 261 if ([[NSUserDefaults standardUserDefaults] |
| (...skipping 12 matching lines...) Expand all Loading... |
| 287 return true; | 274 return true; |
| 288 | 275 |
| 289 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) | 276 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) |
| 290 return false; | 277 return false; |
| 291 | 278 |
| 292 // By default, disable it. | 279 // By default, disable it. |
| 293 return false; | 280 return false; |
| 294 } | 281 } |
| 295 | 282 |
| 296 } // namespace experimental_flags | 283 } // namespace experimental_flags |
| OLD | NEW |