Chromium Code Reviews| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 bool UseOnlyLocalHeuristicsForPasswordGeneration() { | 302 bool UseOnlyLocalHeuristicsForPasswordGeneration() { |
| 303 if ([[NSUserDefaults standardUserDefaults] | 303 if ([[NSUserDefaults standardUserDefaults] |
| 304 boolForKey:kHeuristicsForPasswordGeneration]) { | 304 boolForKey:kHeuristicsForPasswordGeneration]) { |
| 305 return true; | 305 return true; |
| 306 } | 306 } |
| 307 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 307 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 308 return command_line->HasSwitch( | 308 return command_line->HasSwitch( |
| 309 autofill::switches::kLocalHeuristicsOnlyForPasswordGeneration); | 309 autofill::switches::kLocalHeuristicsOnlyForPasswordGeneration); |
| 310 } | 310 } |
| 311 | 311 |
| 312 bool IsSuggestionsUIEnabled() { | |
| 313 // Check if the experimental flag is forced on or off. | |
| 314 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
| 315 if (command_line->HasSwitch(switches::kEnableSuggestionsUI)) { | |
|
marq (ping after 24h)
2017/01/19 16:32:31
Is the usual pattern when both 'enable' and 'disab
gambard
2017/01/19 17:50:12
It is the one used in the other flags.
marq (ping after 24h)
2017/01/20 12:34:46
OK.
| |
| 316 return true; | |
| 317 } else if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) { | |
|
marq (ping after 24h)
2017/01/19 16:32:31
no 'else' after return; just
if ()
return
if (
gambard
2017/01/19 17:50:11
Done.
| |
| 318 return false; | |
| 319 } | |
| 320 | |
| 321 // By default, disable it. | |
| 322 return false; | |
| 323 } | |
| 324 | |
| 312 } // namespace experimental_flags | 325 } // namespace experimental_flags |
| OLD | NEW |