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 10 matching lines...) Expand all Loading... | |
21 #include "ios/chrome/browser/chrome_switches.h" | 21 #include "ios/chrome/browser/chrome_switches.h" |
22 #include "ios/web/public/web_view_creation_util.h" | 22 #include "ios/web/public/web_view_creation_util.h" |
23 | 23 |
24 namespace { | 24 namespace { |
25 NSString* const kEnableAlertOnBackgroundUpload = | 25 NSString* const kEnableAlertOnBackgroundUpload = |
26 @"EnableAlertsOnBackgroundUpload"; | 26 @"EnableAlertsOnBackgroundUpload"; |
27 NSString* const kEnableViewCopyPasswords = @"EnableViewCopyPasswords"; | 27 NSString* const kEnableViewCopyPasswords = @"EnableViewCopyPasswords"; |
28 NSString* const kHeuristicsForPasswordGeneration = | 28 NSString* const kHeuristicsForPasswordGeneration = |
29 @"HeuristicsForPasswordGeneration"; | 29 @"HeuristicsForPasswordGeneration"; |
30 const char* const kWKWebViewTrialName = "IOSUseWKWebView"; | 30 const char* const kWKWebViewTrialName = "IOSUseWKWebView"; |
31 NSString* const kEnableReadingList = @"EnableReadingList"; | |
31 | 32 |
32 enum class WKWebViewEligibility { | 33 enum class WKWebViewEligibility { |
33 // UNSET indicates that no explicit call to set eligibility has been made, | 34 // UNSET indicates that no explicit call to set eligibility has been made, |
34 // nor has a default value been assumed due to checking eligibility. | 35 // nor has a default value been assumed due to checking eligibility. |
35 UNSET, | 36 UNSET, |
36 ELIGIBLE, | 37 ELIGIBLE, |
37 INELIGIBLE | 38 INELIGIBLE |
38 }; | 39 }; |
39 WKWebViewEligibility g_wkwebview_trial_eligibility = | 40 WKWebViewEligibility g_wkwebview_trial_eligibility = |
40 WKWebViewEligibility::UNSET; | 41 WKWebViewEligibility::UNSET; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 } else if (command_line->HasSwitch(switches::kDisableTabSwitcher)) { | 232 } else if (command_line->HasSwitch(switches::kDisableTabSwitcher)) { |
232 return false; | 233 return false; |
233 } | 234 } |
234 | 235 |
235 // Check if the finch experiment is turned on. | 236 // Check if the finch experiment is turned on. |
236 std::string group_name = base::FieldTrialList::FindFullName("IOSTabSwitcher"); | 237 std::string group_name = base::FieldTrialList::FindFullName("IOSTabSwitcher"); |
237 return base::StartsWith(group_name, "Enabled", | 238 return base::StartsWith(group_name, "Enabled", |
238 base::CompareCase::INSENSITIVE_ASCII); | 239 base::CompareCase::INSENSITIVE_ASCII); |
239 } | 240 } |
240 | 241 |
242 bool IsReadingListEnabled() { | |
243 if ([[NSUserDefaults standardUserDefaults] boolForKey:kEnableReadingList]) { | |
Olivier
2016/01/25 17:26:39
why not just return [NSUserDefaults... boolForKey:
sdefresne
2016/01/26 10:03:15
+1
stkhapugin
2016/01/26 12:28:33
Done.
| |
244 return true; | |
245 } | |
246 | |
247 return false; | |
248 } | |
249 | |
241 } // namespace experimental_flags | 250 } // namespace experimental_flags |
OLD | NEW |