| 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> |
| 11 #import <Foundation/Foundation.h> | 11 #import <Foundation/Foundation.h> |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 18 #include "base/strings/sys_string_conversions.h" | 18 #include "base/strings/sys_string_conversions.h" |
| 19 #include "components/autofill/core/common/autofill_switches.h" | 19 #include "components/autofill/core/common/autofill_switches.h" |
| 20 #include "components/reading_list/core/reading_list_switches.h" | |
| 21 #include "components/variations/variations_associated_data.h" | 20 #include "components/variations/variations_associated_data.h" |
| 22 #include "ios/chrome/browser/chrome_switches.h" | 21 #include "ios/chrome/browser/chrome_switches.h" |
| 23 #include "ios/web/public/web_view_creation_util.h" | 22 #include "ios/web/public/web_view_creation_util.h" |
| 24 | 23 |
| 25 #if !defined(__has_feature) || !__has_feature(objc_arc) | 24 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 26 #error "This file requires ARC support." | 25 #error "This file requires ARC support." |
| 27 #endif | 26 #endif |
| 28 | 27 |
| 29 namespace { | 28 namespace { |
| 30 | 29 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 base::FieldTrialList::FindFullName("PhysicalWebEnabled"); | 211 base::FieldTrialList::FindFullName("PhysicalWebEnabled"); |
| 213 return base::StartsWith(group_name, "Enabled", | 212 return base::StartsWith(group_name, "Enabled", |
| 214 base::CompareCase::INSENSITIVE_ASCII); | 213 base::CompareCase::INSENSITIVE_ASCII); |
| 215 } | 214 } |
| 216 | 215 |
| 217 bool IsReaderModeEnabled() { | 216 bool IsReaderModeEnabled() { |
| 218 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 217 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 219 switches::kEnableReaderModeToolbarIcon); | 218 switches::kEnableReaderModeToolbarIcon); |
| 220 } | 219 } |
| 221 | 220 |
| 222 bool IsReadingListEnabled() { | |
| 223 return reading_list::switches::IsReadingListEnabled(); | |
| 224 } | |
| 225 | |
| 226 bool IsSafariVCSignInEnabled() { | 221 bool IsSafariVCSignInEnabled() { |
| 227 return ![[NSUserDefaults standardUserDefaults] | 222 return ![[NSUserDefaults standardUserDefaults] |
| 228 boolForKey:kSafariVCSignInDisabled]; | 223 boolForKey:kSafariVCSignInDisabled]; |
| 229 } | 224 } |
| 230 | 225 |
| 231 bool IsStartupCrashEnabled() { | 226 bool IsStartupCrashEnabled() { |
| 232 return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableStartupCrash]; | 227 return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableStartupCrash]; |
| 233 } | 228 } |
| 234 | 229 |
| 235 bool IsTabStripAutoScrollNewTabsEnabled() { | 230 bool IsTabStripAutoScrollNewTabsEnabled() { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 262 return true; | 257 return true; |
| 263 | 258 |
| 264 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) | 259 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) |
| 265 return false; | 260 return false; |
| 266 | 261 |
| 267 // By default, disable it. | 262 // By default, disable it. |
| 268 return false; | 263 return false; |
| 269 } | 264 } |
| 270 | 265 |
| 271 } // namespace experimental_flags | 266 } // namespace experimental_flags |
| OLD | NEW |