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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 bool IsInWKWebViewExperimentControlGroup() { | 177 bool IsInWKWebViewExperimentControlGroup() { |
178 if (!CanCheckWKWebViewExperiment()) { | 178 if (!CanCheckWKWebViewExperiment()) { |
179 return false; | 179 return false; |
180 } | 180 } |
181 std::string group_name = | 181 std::string group_name = |
182 base::FieldTrialList::FindFullName(kWKWebViewTrialName); | 182 base::FieldTrialList::FindFullName(kWKWebViewTrialName); |
183 return base::StartsWith(group_name, "Control", | 183 return base::StartsWith(group_name, "Control", |
184 base::CompareCase::INSENSITIVE_ASCII); | 184 base::CompareCase::INSENSITIVE_ASCII); |
185 } | 185 } |
186 | 186 |
187 std::string GetWKWebViewSearchParams() { | |
188 if (!CanCheckWKWebViewExperiment()) { | |
189 return std::string(); | |
190 } | |
191 | |
192 return variations::GetVariationParamValue(kWKWebViewTrialName, "esrch"); | |
193 } | |
194 | |
195 bool IsViewCopyPasswordsEnabled() { | 187 bool IsViewCopyPasswordsEnabled() { |
196 NSString* viewCopyPasswordFlag = [[NSUserDefaults standardUserDefaults] | 188 NSString* viewCopyPasswordFlag = [[NSUserDefaults standardUserDefaults] |
197 objectForKey:kEnableViewCopyPasswords]; | 189 objectForKey:kEnableViewCopyPasswords]; |
198 if ([viewCopyPasswordFlag isEqualToString:@"Enabled"]) | 190 if ([viewCopyPasswordFlag isEqualToString:@"Enabled"]) |
199 return true; | 191 return true; |
200 return false; | 192 return false; |
201 } | 193 } |
202 | 194 |
203 bool IsPasswordGenerationEnabled() { | 195 bool IsPasswordGenerationEnabled() { |
204 // This call activates the field trial, if needed, so it must come before any | 196 // This call activates the field trial, if needed, so it must come before any |
(...skipping 27 matching lines...) Expand all Loading... |
232 return false; | 224 return false; |
233 } | 225 } |
234 | 226 |
235 // Check if the finch experiment is turned on. | 227 // Check if the finch experiment is turned on. |
236 std::string group_name = base::FieldTrialList::FindFullName("IOSTabSwitcher"); | 228 std::string group_name = base::FieldTrialList::FindFullName("IOSTabSwitcher"); |
237 return base::StartsWith(group_name, "Enabled", | 229 return base::StartsWith(group_name, "Enabled", |
238 base::CompareCase::INSENSITIVE_ASCII); | 230 base::CompareCase::INSENSITIVE_ASCII); |
239 } | 231 } |
240 | 232 |
241 } // namespace experimental_flags | 233 } // namespace experimental_flags |
OLD | NEW |