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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 "none" }, | 418 "none" }, |
419 { IDS_ASH_SCREEN_ROTATION_ANIMATION_PARTIAL_ROTATION, | 419 { IDS_ASH_SCREEN_ROTATION_ANIMATION_PARTIAL_ROTATION, |
420 ash::switches::kAshEnableScreenRotationAnimation, | 420 ash::switches::kAshEnableScreenRotationAnimation, |
421 "partial-rotation" }, | 421 "partial-rotation" }, |
422 { IDS_ASH_SCREEN_ROTATION_ANIMATION_FULL_ROTATION, | 422 { IDS_ASH_SCREEN_ROTATION_ANIMATION_FULL_ROTATION, |
423 ash::switches::kAshEnableScreenRotationAnimation, | 423 ash::switches::kAshEnableScreenRotationAnimation, |
424 "full-rotation" } | 424 "full-rotation" } |
425 }; | 425 }; |
426 #endif | 426 #endif |
427 | 427 |
| 428 #if defined(OS_CHROMEOS) |
| 429 const Experiment::Choice kDataSaverPromptChoices[] = { |
| 430 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 431 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 432 chromeos::switches::kDisableDataSaverPrompt, "" }, |
| 433 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 434 chromeos::switches::kEnableDataSaverPrompt, "" }, |
| 435 { IDS_FLAGS_DATASAVER_PROMPT_DEMO_MODE, |
| 436 chromeos::switches::kEnableDataSaverPrompt, |
| 437 chromeos::switches::kDataSaverPromptDemoMode }, |
| 438 }; |
| 439 #endif |
| 440 |
428 // RECORDING USER METRICS FOR FLAGS: | 441 // RECORDING USER METRICS FOR FLAGS: |
429 // ----------------------------------------------------------------------------- | 442 // ----------------------------------------------------------------------------- |
430 // The first line of the experiment is the internal name. If you'd like to | 443 // The first line of the experiment is the internal name. If you'd like to |
431 // gather statistics about the usage of your flag, you should append a marker | 444 // gather statistics about the usage of your flag, you should append a marker |
432 // comment to the end of the feature name, like so: | 445 // comment to the end of the feature name, like so: |
433 // "my-special-feature", // FLAGS:RECORD_UMA | 446 // "my-special-feature", // FLAGS:RECORD_UMA |
434 // | 447 // |
435 // After doing that, run | 448 // After doing that, run |
436 // tools/metrics/actions/extract_actions.py | 449 // tools/metrics/actions/extract_actions.py |
437 // to add the metric to actions.xml (which will enable UMA to record your | 450 // to add the metric to actions.xml (which will enable UMA to record your |
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2312 #endif // defined(ENABLE_APP_LIST) | 2325 #endif // defined(ENABLE_APP_LIST) |
2313 #if defined(OS_CHROMEOS) | 2326 #if defined(OS_CHROMEOS) |
2314 { | 2327 { |
2315 "enable-mtp-write-support", | 2328 "enable-mtp-write-support", |
2316 IDS_FLAG_ENABLE_MTP_WRITE_SUPPORT_NAME, | 2329 IDS_FLAG_ENABLE_MTP_WRITE_SUPPORT_NAME, |
2317 IDS_FLAG_ENABLE_MTP_WRITE_SUPPORT_DESCRIPTION, | 2330 IDS_FLAG_ENABLE_MTP_WRITE_SUPPORT_DESCRIPTION, |
2318 kOsCrOS, | 2331 kOsCrOS, |
2319 SINGLE_VALUE_TYPE(chromeos::switches::kEnableMtpWriteSupport) | 2332 SINGLE_VALUE_TYPE(chromeos::switches::kEnableMtpWriteSupport) |
2320 }, | 2333 }, |
2321 #endif // defined(OS_CHROMEOS) | 2334 #endif // defined(OS_CHROMEOS) |
| 2335 #if defined(OS_CHROMEOS) |
| 2336 { |
| 2337 "enable-datasaver-prompt", |
| 2338 IDS_FLAGS_DATASAVER_PROMPT_NAME, |
| 2339 IDS_FLAGS_DATASAVER_PROMPT_DESCRIPTION, |
| 2340 kOsCrOS, |
| 2341 MULTI_VALUE_TYPE(kDataSaverPromptChoices) |
| 2342 }, |
| 2343 #endif // defined(OS_CHROMEOS) |
2322 // NOTE: Adding new command-line switches requires adding corresponding | 2344 // NOTE: Adding new command-line switches requires adding corresponding |
2323 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2345 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
2324 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2346 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
2325 }; | 2347 }; |
2326 | 2348 |
2327 const Experiment* experiments = kExperiments; | 2349 const Experiment* experiments = kExperiments; |
2328 size_t num_experiments = arraysize(kExperiments); | 2350 size_t num_experiments = arraysize(kExperiments); |
2329 | 2351 |
2330 // Stores and encapsulates the little state that about:flags has. | 2352 // Stores and encapsulates the little state that about:flags has. |
2331 class FlagsState { | 2353 class FlagsState { |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2900 } | 2922 } |
2901 | 2923 |
2902 const Experiment* GetExperiments(size_t* count) { | 2924 const Experiment* GetExperiments(size_t* count) { |
2903 *count = num_experiments; | 2925 *count = num_experiments; |
2904 return experiments; | 2926 return experiments; |
2905 } | 2927 } |
2906 | 2928 |
2907 } // namespace testing | 2929 } // namespace testing |
2908 | 2930 |
2909 } // namespace about_flags | 2931 } // namespace about_flags |
OLD | NEW |