OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/about_flags.h" | 5 #include "chrome/browser/about_flags.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, | 431 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
432 chromeos::switches::kDisableDataSaverPrompt, "" }, | 432 chromeos::switches::kDisableDataSaverPrompt, "" }, |
433 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, | 433 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
434 chromeos::switches::kEnableDataSaverPrompt, "" }, | 434 chromeos::switches::kEnableDataSaverPrompt, "" }, |
435 { IDS_FLAGS_DATASAVER_PROMPT_DEMO_MODE, | 435 { IDS_FLAGS_DATASAVER_PROMPT_DEMO_MODE, |
436 chromeos::switches::kEnableDataSaverPrompt, | 436 chromeos::switches::kEnableDataSaverPrompt, |
437 chromeos::switches::kDataSaverPromptDemoMode }, | 437 chromeos::switches::kDataSaverPromptDemoMode }, |
438 }; | 438 }; |
439 #endif | 439 #endif |
440 | 440 |
| 441 const Experiment::Choice kSupervisedUserSafeSitesChoices[] = { |
| 442 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 443 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 444 switches::kSupervisedUserSafeSites, |
| 445 "enabled" }, |
| 446 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 447 switches::kSupervisedUserSafeSites, |
| 448 "disabled" }, |
| 449 { IDS_SUPERVISED_USER_SAFESITES_BLACKLIST_ONLY, |
| 450 switches::kSupervisedUserSafeSites, |
| 451 "blacklist-only" }, |
| 452 { IDS_SUPERVISED_USER_SAFESITES_ONLINE_CHECK_ONLY, |
| 453 switches::kSupervisedUserSafeSites, |
| 454 "online-check-only" } |
| 455 }; |
| 456 |
441 // RECORDING USER METRICS FOR FLAGS: | 457 // RECORDING USER METRICS FOR FLAGS: |
442 // ----------------------------------------------------------------------------- | 458 // ----------------------------------------------------------------------------- |
443 // The first line of the experiment is the internal name. If you'd like to | 459 // The first line of the experiment is the internal name. If you'd like to |
444 // gather statistics about the usage of your flag, you should append a marker | 460 // gather statistics about the usage of your flag, you should append a marker |
445 // comment to the end of the feature name, like so: | 461 // comment to the end of the feature name, like so: |
446 // "my-special-feature", // FLAGS:RECORD_UMA | 462 // "my-special-feature", // FLAGS:RECORD_UMA |
447 // | 463 // |
448 // After doing that, run | 464 // After doing that, run |
449 // tools/metrics/actions/extract_actions.py | 465 // tools/metrics/actions/extract_actions.py |
450 // to add the metric to actions.xml (which will enable UMA to record your | 466 // to add the metric to actions.xml (which will enable UMA to record your |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 }, | 1206 }, |
1191 { | 1207 { |
1192 "enable-suggestions-service", | 1208 "enable-suggestions-service", |
1193 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME, | 1209 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME, |
1194 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION, | 1210 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION, |
1195 kOsAndroid | kOsCrOS, | 1211 kOsAndroid | kOsCrOS, |
1196 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService, | 1212 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService, |
1197 switches::kDisableSuggestionsService) | 1213 switches::kDisableSuggestionsService) |
1198 }, | 1214 }, |
1199 { | 1215 { |
1200 "enable-supervised-user-blacklist", | |
1201 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_NAME, | |
1202 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_DESCRIPTION, | |
1203 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS, | |
1204 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserBlacklist, | |
1205 switches::kDisableSupervisedUserBlacklist) | |
1206 }, | |
1207 { | |
1208 "enable-supervised-user-managed-bookmarks-folder", | 1216 "enable-supervised-user-managed-bookmarks-folder", |
1209 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_NAME, | 1217 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_NAME, |
1210 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_DESCRIPTION, | 1218 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_DESCRIPTION, |
1211 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS, | 1219 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS, |
1212 SINGLE_VALUE_TYPE(switches::kEnableSupervisedUserManagedBookmarksFolder) | 1220 SINGLE_VALUE_TYPE(switches::kEnableSupervisedUserManagedBookmarksFolder) |
1213 }, | 1221 }, |
1214 { | |
1215 "enable-supervised-user-safesites", | |
1216 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_NAME, | |
1217 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_DESCRIPTION, | |
1218 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS, | |
1219 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserSafeSites, | |
1220 switches::kDisableSupervisedUserSafeSites) | |
1221 }, | |
1222 #if defined(ENABLE_APP_LIST) | 1222 #if defined(ENABLE_APP_LIST) |
1223 { | 1223 { |
1224 "enable-sync-app-list", | 1224 "enable-sync-app-list", |
1225 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME, | 1225 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME, |
1226 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION, | 1226 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION, |
1227 kOsDesktop, | 1227 kOsDesktop, |
1228 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableSyncAppList, | 1228 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableSyncAppList, |
1229 app_list::switches::kDisableSyncAppList) | 1229 app_list::switches::kDisableSyncAppList) |
1230 }, | 1230 }, |
1231 #endif | 1231 #endif |
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2334 #endif // defined(OS_CHROMEOS) | 2334 #endif // defined(OS_CHROMEOS) |
2335 #if defined(OS_CHROMEOS) | 2335 #if defined(OS_CHROMEOS) |
2336 { | 2336 { |
2337 "enable-datasaver-prompt", | 2337 "enable-datasaver-prompt", |
2338 IDS_FLAGS_DATASAVER_PROMPT_NAME, | 2338 IDS_FLAGS_DATASAVER_PROMPT_NAME, |
2339 IDS_FLAGS_DATASAVER_PROMPT_DESCRIPTION, | 2339 IDS_FLAGS_DATASAVER_PROMPT_DESCRIPTION, |
2340 kOsCrOS, | 2340 kOsCrOS, |
2341 MULTI_VALUE_TYPE(kDataSaverPromptChoices) | 2341 MULTI_VALUE_TYPE(kDataSaverPromptChoices) |
2342 }, | 2342 }, |
2343 #endif // defined(OS_CHROMEOS) | 2343 #endif // defined(OS_CHROMEOS) |
| 2344 { |
| 2345 "supervised-user-safesites", |
| 2346 IDS_FLAGS_SUPERVISED_USER_SAFESITES_NAME, |
| 2347 IDS_FLAGS_SUPERVISED_USER_SAFESITES_DESCRIPTION, |
| 2348 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS, |
| 2349 MULTI_VALUE_TYPE(kSupervisedUserSafeSitesChoices) |
| 2350 }, |
2344 // NOTE: Adding new command-line switches requires adding corresponding | 2351 // NOTE: Adding new command-line switches requires adding corresponding |
2345 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2352 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
2346 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2353 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
2347 }; | 2354 }; |
2348 | 2355 |
2349 const Experiment* experiments = kExperiments; | 2356 const Experiment* experiments = kExperiments; |
2350 size_t num_experiments = arraysize(kExperiments); | 2357 size_t num_experiments = arraysize(kExperiments); |
2351 | 2358 |
2352 // Stores and encapsulates the little state that about:flags has. | 2359 // Stores and encapsulates the little state that about:flags has. |
2353 class FlagsState { | 2360 class FlagsState { |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2922 } | 2929 } |
2923 | 2930 |
2924 const Experiment* GetExperiments(size_t* count) { | 2931 const Experiment* GetExperiments(size_t* count) { |
2925 *count = num_experiments; | 2932 *count = num_experiments; |
2926 return experiments; | 2933 return experiments; |
2927 } | 2934 } |
2928 | 2935 |
2929 } // namespace testing | 2936 } // namespace testing |
2930 | 2937 |
2931 } // namespace about_flags | 2938 } // namespace about_flags |
OLD | NEW |