| 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 | |
| 107 bool IsAutoReloadEnabled() { | 88 bool IsAutoReloadEnabled() { |
| 108 std::string group_name = base::FieldTrialList::FindFullName("IOSAutoReload"); | 89 std::string group_name = base::FieldTrialList::FindFullName("IOSAutoReload"); |
| 109 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 90 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 110 if (command_line->HasSwitch(switches::kEnableOfflineAutoReload)) | 91 if (command_line->HasSwitch(switches::kEnableOfflineAutoReload)) |
| 111 return true; | 92 return true; |
| 112 if (command_line->HasSwitch(switches::kDisableOfflineAutoReload)) | 93 if (command_line->HasSwitch(switches::kDisableOfflineAutoReload)) |
| 113 return false; | 94 return false; |
| 114 return base::StartsWith(group_name, "Enabled", | 95 return base::StartsWith(group_name, "Enabled", |
| 115 base::CompareCase::INSENSITIVE_ASCII); | 96 base::CompareCase::INSENSITIVE_ASCII); |
| 116 } | 97 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 return true; | 292 return true; |
| 312 | 293 |
| 313 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) | 294 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) |
| 314 return false; | 295 return false; |
| 315 | 296 |
| 316 // By default, disable it. | 297 // By default, disable it. |
| 317 return false; | 298 return false; |
| 318 } | 299 } |
| 319 | 300 |
| 320 } // namespace experimental_flags | 301 } // namespace experimental_flags |
| OLD | NEW |