| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 | 104 |
| 105 bool IsAllBookmarksEnabled() { | 105 bool IsAllBookmarksEnabled() { |
| 106 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 106 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 107 if (command_line->HasSwitch(switches::kEnableAllBookmarksView)) { | 107 if (command_line->HasSwitch(switches::kEnableAllBookmarksView)) { |
| 108 return true; | 108 return true; |
| 109 } else if (command_line->HasSwitch(switches::kDisableAllBookmarksView)) { | 109 } else if (command_line->HasSwitch(switches::kDisableAllBookmarksView)) { |
| 110 return false; | 110 return false; |
| 111 } | 111 } |
| 112 | 112 |
| 113 // Check if the finch experiment is turned on. Flag is off by default. | 113 // Check if the finch experiment exists. |
| 114 std::string group_name = | 114 std::string group_name = |
| 115 base::FieldTrialList::FindFullName("RemoveAllBookmarks"); | 115 base::FieldTrialList::FindFullName("RemoveAllBookmarks"); |
| 116 | 116 |
| 117 if (group_name.empty()) { |
| 118 return true; // If no finch experiment, keep all bookmarks enabled. |
| 119 } |
| 117 return base::StartsWith(group_name, "Enabled", | 120 return base::StartsWith(group_name, "Enabled", |
| 118 base::CompareCase::INSENSITIVE_ASCII); | 121 base::CompareCase::INSENSITIVE_ASCII); |
| 119 } | 122 } |
| 120 | 123 |
| 121 } // namespace experimental_flags | 124 } // namespace experimental_flags |
| OLD | NEW |