| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 NSInteger status = [[NSUserDefaults standardUserDefaults] | 78 NSInteger status = [[NSUserDefaults standardUserDefaults] |
| 79 integerForKey:kWhatsNewPromoStatus]; | 79 integerForKey:kWhatsNewPromoStatus]; |
| 80 return static_cast<WhatsNewPromoStatus>(status); | 80 return static_cast<WhatsNewPromoStatus>(status); |
| 81 } | 81 } |
| 82 | 82 |
| 83 bool IsAlertOnBackgroundUploadEnabled() { | 83 bool IsAlertOnBackgroundUploadEnabled() { |
| 84 return [[NSUserDefaults standardUserDefaults] | 84 return [[NSUserDefaults standardUserDefaults] |
| 85 boolForKey:kEnableAlertOnBackgroundUpload]; | 85 boolForKey:kEnableAlertOnBackgroundUpload]; |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool IsAllBookmarksEnabled() { |
| 89 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 90 if (command_line->HasSwitch(switches::kEnableAllBookmarksView)) { |
| 91 return true; |
| 92 } else if (command_line->HasSwitch(switches::kDisableAllBookmarksView)) { |
| 93 return false; |
| 94 } |
| 95 |
| 96 // Check if the finch experiment exists. |
| 97 std::string group_name = |
| 98 base::FieldTrialList::FindFullName("RemoveAllBookmarks"); |
| 99 |
| 100 if (group_name.empty()) { |
| 101 return false; // If no finch experiment, all bookmarks is disabled. |
| 102 } |
| 103 return base::StartsWith(group_name, "Enabled", |
| 104 base::CompareCase::INSENSITIVE_ASCII); |
| 105 } |
| 106 |
| 88 bool IsAutoReloadEnabled() { | 107 bool IsAutoReloadEnabled() { |
| 89 std::string group_name = base::FieldTrialList::FindFullName("IOSAutoReload"); | 108 std::string group_name = base::FieldTrialList::FindFullName("IOSAutoReload"); |
| 90 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 109 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 91 if (command_line->HasSwitch(switches::kEnableOfflineAutoReload)) | 110 if (command_line->HasSwitch(switches::kEnableOfflineAutoReload)) |
| 92 return true; | 111 return true; |
| 93 if (command_line->HasSwitch(switches::kDisableOfflineAutoReload)) | 112 if (command_line->HasSwitch(switches::kDisableOfflineAutoReload)) |
| 94 return false; | 113 return false; |
| 95 return base::StartsWith(group_name, "Enabled", | 114 return base::StartsWith(group_name, "Enabled", |
| 96 base::CompareCase::INSENSITIVE_ASCII); | 115 base::CompareCase::INSENSITIVE_ASCII); |
| 97 } | 116 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 return true; | 311 return true; |
| 293 | 312 |
| 294 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) | 313 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) |
| 295 return false; | 314 return false; |
| 296 | 315 |
| 297 // By default, disable it. | 316 // By default, disable it. |
| 298 return false; | 317 return false; |
| 299 } | 318 } |
| 300 | 319 |
| 301 } // namespace experimental_flags | 320 } // namespace experimental_flags |
| OLD | NEW |