Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 // Implementation of about_flags for iOS that sets flags based on experimental | 5 // Implementation of about_flags for iOS that sets flags based on experimental |
| 6 // settings. | 6 // settings. |
| 7 | 7 |
| 8 #include "ios/chrome/browser/about_flags.h" | 8 #include "ios/chrome/browser/about_flags.h" |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| 11 #include <stdint.h> | 11 #include <stdint.h> |
| 12 #import <UIKit/UIKit.h> | 12 #import <UIKit/UIKit.h> |
| 13 | 13 |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/singleton.h" | 18 #include "base/memory/singleton.h" |
| 19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
| 20 #include "base/strings/sys_string_conversions.h" | 20 #include "base/strings/sys_string_conversions.h" |
| 21 #include "base/sys_info.h" | 21 #include "base/sys_info.h" |
| 22 #include "base/task_scheduler/switches.h" | |
| 22 #include "components/dom_distiller/core/dom_distiller_switches.h" | 23 #include "components/dom_distiller/core/dom_distiller_switches.h" |
| 23 #include "components/flags_ui/feature_entry.h" | 24 #include "components/flags_ui/feature_entry.h" |
| 24 #include "components/flags_ui/feature_entry_macros.h" | 25 #include "components/flags_ui/feature_entry_macros.h" |
| 25 #include "components/flags_ui/flags_storage.h" | 26 #include "components/flags_ui/flags_storage.h" |
| 26 #include "components/flags_ui/flags_ui_switches.h" | 27 #include "components/flags_ui/flags_ui_switches.h" |
| 27 #include "components/strings/grit/components_strings.h" | 28 #include "components/strings/grit/components_strings.h" |
| 28 #include "components/sync/driver/sync_driver_switches.h" | 29 #include "components/sync/driver/sync_driver_switches.h" |
| 29 #include "google_apis/gaia/gaia_switches.h" | 30 #include "google_apis/gaia/gaia_switches.h" |
| 30 #include "ios/chrome/browser/chrome_switches.h" | 31 #include "ios/chrome/browser/chrome_switches.h" |
| 31 #include "ios/chrome/grit/ios_strings.h" | 32 #include "ios/chrome/grit/ios_strings.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 50 // When adding a new choice, add it to the end of the list. | 51 // When adding a new choice, add it to the end of the list. |
| 51 const flags_ui::FeatureEntry kFeatureEntries[] = { | 52 const flags_ui::FeatureEntry kFeatureEntries[] = { |
| 52 {"contextual-search", IDS_IOS_FLAGS_CONTEXTUAL_SEARCH, | 53 {"contextual-search", IDS_IOS_FLAGS_CONTEXTUAL_SEARCH, |
| 53 IDS_IOS_FLAGS_CONTEXTUAL_SEARCH_DESCRIPTION, flags_ui::kOsIos, | 54 IDS_IOS_FLAGS_CONTEXTUAL_SEARCH_DESCRIPTION, flags_ui::kOsIos, |
| 54 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch, | 55 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch, |
| 55 switches::kDisableContextualSearch)}, | 56 switches::kDisableContextualSearch)}, |
| 56 {"ios-physical-web", IDS_IOS_FLAGS_PHYSICAL_WEB, | 57 {"ios-physical-web", IDS_IOS_FLAGS_PHYSICAL_WEB, |
| 57 IDS_IOS_FLAGS_PHYSICAL_WEB_DESCRIPTION, flags_ui::kOsIos, | 58 IDS_IOS_FLAGS_PHYSICAL_WEB_DESCRIPTION, flags_ui::kOsIos, |
| 58 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableIOSPhysicalWeb, | 59 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableIOSPhysicalWeb, |
| 59 switches::kDisableIOSPhysicalWeb)}, | 60 switches::kDisableIOSPhysicalWeb)}, |
| 61 {"browser-task-scheduler", IDS_FLAGS_BROWSER_TASK_SCHEDULER_NAME, | |
|
rohitrao (ping after 24h)
2016/10/25 12:07:07
Are you simply this to maintain consistency with d
robliao
2016/10/26 17:28:19
Users that plan on opting into the task scheduler
| |
| 62 IDS_FLAGS_BROWSER_TASK_SCHEDULER_DESCRIPTION, flags_ui::kOsIos, | |
| 63 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableBrowserTaskScheduler, | |
| 64 switches::kDisableBrowserTaskScheduler)}, | |
| 60 }; | 65 }; |
| 61 | 66 |
| 62 // Add all switches from experimental flags to |command_line|. | 67 // Add all switches from experimental flags to |command_line|. |
| 63 void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { | 68 void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { |
| 64 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; | 69 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 65 | 70 |
| 66 // GAIA staging environment. | 71 // GAIA staging environment. |
| 67 NSString* kGAIAEnvironment = @"GAIAEnvironment"; | 72 NSString* kGAIAEnvironment = @"GAIAEnvironment"; |
| 68 NSString* gaia_environment = [defaults stringForKey:kGAIAEnvironment]; | 73 NSString* gaia_environment = [defaults stringForKey:kGAIAEnvironment]; |
| 69 if ([gaia_environment isEqualToString:@"Staging"]) { | 74 if ([gaia_environment isEqualToString:@"Staging"]) { |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 } | 310 } |
| 306 | 311 |
| 307 namespace testing { | 312 namespace testing { |
| 308 | 313 |
| 309 const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { | 314 const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { |
| 310 *count = arraysize(kFeatureEntries); | 315 *count = arraysize(kFeatureEntries); |
| 311 return kFeatureEntries; | 316 return kFeatureEntries; |
| 312 } | 317 } |
| 313 | 318 |
| 314 } // namespace testing | 319 } // namespace testing |
| OLD | NEW |