| 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 #if defined(OS_CHROMEOS) | 532 #if defined(OS_CHROMEOS) |
| 533 const Experiment::Choice kCrosRegionsModeChoices[] = { | 533 const Experiment::Choice kCrosRegionsModeChoices[] = { |
| 534 { IDS_FLAGS_CROS_REGIONS_MODE_DEFAULT, "", "" }, | 534 { IDS_FLAGS_CROS_REGIONS_MODE_DEFAULT, "", "" }, |
| 535 { IDS_FLAGS_CROS_REGIONS_MODE_OVERRIDE, chromeos::switches::kCrosRegionsMode, | 535 { IDS_FLAGS_CROS_REGIONS_MODE_OVERRIDE, chromeos::switches::kCrosRegionsMode, |
| 536 chromeos::switches::kCrosRegionsModeOverride }, | 536 chromeos::switches::kCrosRegionsModeOverride }, |
| 537 { IDS_FLAGS_CROS_REGIONS_MODE_HIDE, chromeos::switches::kCrosRegionsMode, | 537 { IDS_FLAGS_CROS_REGIONS_MODE_HIDE, chromeos::switches::kCrosRegionsMode, |
| 538 chromeos::switches::kCrosRegionsModeHide }, | 538 chromeos::switches::kCrosRegionsModeHide }, |
| 539 }; | 539 }; |
| 540 #endif // defined(OS_CHROMEOS) | 540 #endif // defined(OS_CHROMEOS) |
| 541 | 541 |
| 542 #if defined(OS_WIN) |
| 543 const Experiment::Choice kPpapiWin32kLockdown[] = { |
| 544 {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""}, |
| 545 {IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 546 switches::kEnableWin32kLockDownMimeTypes, ""}, |
| 547 {IDS_FLAGS_PPAPI_WIN32K_LOCKDOWN_FLASH_ONLY, |
| 548 switches::kEnableWin32kLockDownMimeTypes, |
| 549 "application/x-shockwave-flash,application/futuresplash"}, |
| 550 {IDS_FLAGS_PPAPI_WIN32K_LOCKDOWN_PDF_ONLY, |
| 551 switches::kEnableWin32kLockDownMimeTypes, |
| 552 "application/x-google-chrome-pdf,application/pdf"}, |
| 553 {IDS_FLAGS_PPAPI_WIN32K_LOCKDOWN_FLASH_AND_PDF, |
| 554 switches::kEnableWin32kLockDownMimeTypes, |
| 555 "application/x-shockwave-flash,application/futuresplash," |
| 556 "application/x-google-chrome-pdf,application/pdf"}, |
| 557 {IDS_FLAGS_PPAPI_WIN32K_LOCKDOWN_ALL, |
| 558 switches::kEnableWin32kLockDownMimeTypes, "*"}, |
| 559 }; |
| 560 #endif // defined(OS_WIN) |
| 561 |
| 542 // RECORDING USER METRICS FOR FLAGS: | 562 // RECORDING USER METRICS FOR FLAGS: |
| 543 // ----------------------------------------------------------------------------- | 563 // ----------------------------------------------------------------------------- |
| 544 // The first line of the experiment is the internal name. If you'd like to | 564 // The first line of the experiment is the internal name. If you'd like to |
| 545 // gather statistics about the usage of your flag, you should append a marker | 565 // gather statistics about the usage of your flag, you should append a marker |
| 546 // comment to the end of the feature name, like so: | 566 // comment to the end of the feature name, like so: |
| 547 // "my-special-feature", // FLAGS:RECORD_UMA | 567 // "my-special-feature", // FLAGS:RECORD_UMA |
| 548 // | 568 // |
| 549 // After doing that, run | 569 // After doing that, run |
| 550 // tools/metrics/actions/extract_actions.py | 570 // tools/metrics/actions/extract_actions.py |
| 551 // to add the metric to actions.xml (which will enable UMA to record your | 571 // to add the metric to actions.xml (which will enable UMA to record your |
| (...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2059 kOsDesktop, | 2079 kOsDesktop, |
| 2060 SINGLE_VALUE_TYPE(switches::kEnableWebUsbOnAnyOrigin)}, | 2080 SINGLE_VALUE_TYPE(switches::kEnableWebUsbOnAnyOrigin)}, |
| 2061 #endif | 2081 #endif |
| 2062 #if defined(OS_CHROMEOS) | 2082 #if defined(OS_CHROMEOS) |
| 2063 {"cros-regions-mode", | 2083 {"cros-regions-mode", |
| 2064 IDS_FLAGS_CROS_REGIONS_MODE_NAME, | 2084 IDS_FLAGS_CROS_REGIONS_MODE_NAME, |
| 2065 IDS_FLAGS_CROS_REGIONS_MODE_DESCRIPTION, | 2085 IDS_FLAGS_CROS_REGIONS_MODE_DESCRIPTION, |
| 2066 kOsCrOS, | 2086 kOsCrOS, |
| 2067 MULTI_VALUE_TYPE(kCrosRegionsModeChoices)}, | 2087 MULTI_VALUE_TYPE(kCrosRegionsModeChoices)}, |
| 2068 #endif // OS_CHROMEOS | 2088 #endif // OS_CHROMEOS |
| 2089 #if defined(OS_WIN) |
| 2090 {"enable-ppapi-win32k-lockdown", // FLAGS:RECORD_UMA |
| 2091 IDS_FLAGS_PPAPI_WIN32K_LOCKDOWN_NAME, |
| 2092 IDS_FLAGS_PPAPI_WIN32K_LOCKDOWN_DESCRIPTION, kOsWin, |
| 2093 MULTI_VALUE_TYPE(kPpapiWin32kLockdown)}, |
| 2094 #endif // defined(OS_WIN) |
| 2069 // NOTE: Adding new command-line switches requires adding corresponding | 2095 // NOTE: Adding new command-line switches requires adding corresponding |
| 2070 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2096 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
| 2071 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2097 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
| 2072 }; | 2098 }; |
| 2073 | 2099 |
| 2074 const Experiment* experiments = kExperiments; | 2100 const Experiment* experiments = kExperiments; |
| 2075 size_t num_experiments = arraysize(kExperiments); | 2101 size_t num_experiments = arraysize(kExperiments); |
| 2076 | 2102 |
| 2077 // Stores and encapsulates the little state that about:flags has. | 2103 // Stores and encapsulates the little state that about:flags has. |
| 2078 class FlagsState { | 2104 class FlagsState { |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2701 } | 2727 } |
| 2702 | 2728 |
| 2703 const Experiment* GetExperiments(size_t* count) { | 2729 const Experiment* GetExperiments(size_t* count) { |
| 2704 *count = num_experiments; | 2730 *count = num_experiments; |
| 2705 return experiments; | 2731 return experiments; |
| 2706 } | 2732 } |
| 2707 | 2733 |
| 2708 } // namespace testing | 2734 } // namespace testing |
| 2709 | 2735 |
| 2710 } // namespace about_flags | 2736 } // namespace about_flags |
| OLD | NEW |